diff --git a/.travis.yml b/.travis.yml index c92e5d6ec13..f91d74f5fd0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,22 +9,22 @@ matrix: env: ## Jobs used when downloading JDK during testing. ## all-tests = junit + nonjunit + demos. Separately, test building the JDK. - - BUILDJDK=downloadjdk JDKVER=jdk7 GROUP=all-tests - - BUILDJDK=downloadjdk JDKVER=jdk7 GROUP=jdk.jar - BUILDJDK=downloadjdk JDKVER=jdk8 GROUP=all-tests - BUILDJDK=downloadjdk JDKVER=jdk8 GROUP=jdk.jar - - BUILDJDK=downloadjdk JDKVER=jdk7 GROUP=downstream - BUILDJDK=downloadjdk JDKVER=jdk8 GROUP=downstream +#TODO - BUILDJDK=downloadjdk JDKVER=jdk9 GROUP=all-tests +#TODO - BUILDJDK=downloadjdk JDKVER=jdk9 GROUP=jdk.jar +#TODO - BUILDJDK=downloadjdk JDKVER=jdk9 GROUP=downstream - BUILDJDK=downloadjdk JDKVER=jdkany GROUP=misc ## Jobs used when building JDK during testing. -# - BUILDJDK=buildjdk JDKVER=jdk7 GROUP=junit -# - BUILDJDK=buildjdk JDKVER=jdk7 GROUP=nonjunit -# - BUILDJDK=buildjdk JDKVER=jdk7 GROUP=demos # - BUILDJDK=buildjdk JDKVER=jdk8 GROUP=junit # - BUILDJDK=buildjdk JDKVER=jdk8 GROUP=nonjunit # - BUILDJDK=buildjdk JDKVER=jdk8 GROUP=demos -# - BUILDJDK=buildjdk JDKVER=jdk7 GROUP=downstream # - BUILDJDK=buildjdk JDKVER=jdk8 GROUP=downstream +# - BUILDJDK=buildjdk JDKVER=jdk9 GROUP=junit +# - BUILDJDK=buildjdk JDKVER=jdk9 GROUP=nonjunit +# - BUILDJDK=buildjdk JDKVER=jdk9 GROUP=demos +# - BUILDJDK=buildjdk JDKVER=jdk9 GROUP=downstream # - BUILDJDK=buildjdk JDKVER=jdkany GROUP=misc diff --git a/README-developers.txt b/README-developers.txt index 2124fc06c04..ee1bf58126f 100644 --- a/README-developers.txt +++ b/README-developers.txt @@ -6,7 +6,6 @@ This repository contains several related projects: framework the "framework" aspects of the Checker Framework checker the type checkers provided with the Checker Framework - stubparser a parser for Java source code that supports type annotations javacutil utilities for javac dataflow a dataflow framework diff --git a/build-common.properties b/build-common.properties index 400b2357b7d..2212d743203 100644 --- a/build-common.properties +++ b/build-common.properties @@ -39,9 +39,6 @@ annotation-file-utilities.lib=${annotation-file-utilities.loc}/annotation-file-u # The location and libraries for all sub-projects -stubparser.loc=${checkerframework}/stubparser -stubparser.lib=${stubparser.loc}/dist/stubparser.jar - javacutil.loc=${checkerframework}/javacutil javacutil.lib=${javacutil.loc}/dist/javacutil.jar javacutil.sources.lib=${javacutil.loc}/dist/javacutil-source.jar @@ -59,9 +56,12 @@ framework.lib=${framework.loc}/dist/framework.jar junit.lib=${framework.loc}/tests/junit-4.12.jar hamcrest.lib=${framework.loc}/tests/hamcrest-core-1.3.jar +javaparser.core.lib=${framework.loc}/lib/javaparser-core.jar checker.loc=${checkerframework}/checker checker.lib=${checker.loc}/dist/checker.jar +# Place to store compilation results to avoid overwriting them. +checker.lib.tmp=${checker.loc}/dist/checker-tmp.jar checker.qual.lib=${checker.loc}/dist/checker-qual.jar checker.qual.sources.lib=${checker.loc}/dist/checker-qual-source.jar checker.compat.qual.lib=${checker.loc}/dist/checker-compat-qual.jar @@ -73,7 +73,6 @@ checker.javadoc.lib=${checker.loc}/dist/checker-javadoc.jar checker.jdk8orhigher.sources=org/checkerframework/checker/nullness/Opt.java - # How to find the error-prone compiler # TODO: currently you have to copy this .jar to ~/.ant/lib # How can we set this from here? diff --git a/build-styleguide.xml b/build-styleguide.xml index b75ce463835..6eabf16d12a 100644 --- a/build-styleguide.xml +++ b/build-styleguide.xml @@ -12,8 +12,8 @@ - - + + diff --git a/build.xml b/build.xml index cc9b29b612c..9f5655300b5 100644 --- a/build.xml +++ b/build.xml @@ -92,9 +92,6 @@ - - - + excludes="checker/jdk/,checker/tests/nullness-javac-errors/,framework/tests/whole-program-inference/annotated/"/> @@ -175,9 +172,6 @@ - - - @@ -191,8 +185,6 @@ - - diff --git a/changelog.txt b/changelog.txt index e3da3a13b78..e0ed4541750 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,18 @@ --------------------------------------------------------------------------- +Version 2.2.0, ?? 2017 + +A Java 8 JVM is required to run the Checker Framework. +You can still typecheck and compile Java 7 (or earlier) code. + +The stub file format has changed to be more similar to regular Java syntax. +Most notably, receiver annotations are written using standard Java 8 syntax +(a special first formal paramter named "this") and inner classes are written +using standard Java syntax (rather than at the top level using a name that +contains "$". You need to update your stub files to conform to the new syntax. + +--------------------------------------------------------------------------- + Version 2.1.14, 3 August 2017 Nullness Checker change to annotated JDK: The type argument to the Class, diff --git a/checker/bin-devel/git.pre-commit b/checker/bin-devel/git.pre-commit index 13c9baecf78..1243d73a30a 100755 --- a/checker/bin-devel/git.pre-commit +++ b/checker/bin-devel/git.pre-commit @@ -12,7 +12,7 @@ set -e # Need to keep checked files in sync with formatted.java.files in # build.xml. Otherwise `ant reformat` might not reformat a file that this # hook complains about. -CHANGED_JAVA_FILES=`git diff --staged --name-only --diff-filter=ACM | grep '\.java$' | grep -v '/jdk/' | grep -v '/stubparser/' | grep -v '/eclipse/' ` || true +CHANGED_JAVA_FILES=`git diff --staged --name-only --diff-filter=ACM | grep '\.java$' | grep -v '/jdk/' | grep -v '/eclipse/' ` || true # echo CHANGED_JAVA_FILES "'"${CHANGED_JAVA_FILES}"'" if [ ! -z "$CHANGED_JAVA_FILES" ]; then ant -silent update-run-google-java-format diff --git a/checker/bin-devel/javac b/checker/bin-devel/javac index fd5c6105acc..ae73b2b3c1c 100755 --- a/checker/bin-devel/javac +++ b/checker/bin-devel/javac @@ -35,7 +35,7 @@ annoToolsDir="${cfDir}"/../annotation-tools # Put afu jar files last, as they might contain out-of-date CF files. # Put "checker" after the other sub-projects, as "ant bindist" puts # other projects into the checker/build directory. -buildDirs="${cfDir}"/dataflow/build:"${cfDir}"/javacutil/build:"${cfDir}"/stubparser/build:"${cfDir}"/framework/build:"${cfDir}"/checker/build:"${annoToolsDir}"/scene-lib/bin:"${annoToolsDir}"/annotation-file-utilities/annotation-file-utilities.jar +buildDirs="${cfDir}"/dataflow/build:"${cfDir}"/javacutil/build:"${cfDir}"/framework/build:"${cfDir}"/checker/build:"${cfDir}"/checker/lib/javaparser-core.jar:"${annoToolsDir}"/scene-lib/bin:"${annoToolsDir}"/annotation-file-utilities/annotation-file-utilities.jar ## Preserve quoting and spaces in arguments, which would otherwise be lost ## due to being passed through the shell twice. diff --git a/checker/bin-devel/javac-debug b/checker/bin-devel/javac-debug index 82d08da67d5..7540a7d4a84 100755 --- a/checker/bin-devel/javac-debug +++ b/checker/bin-devel/javac-debug @@ -38,7 +38,7 @@ annoToolsDir="${cfDir}"/../annotation-tools # Put afu jar files last, as they might contain out-of-date CF files. # Put "checker" after the other sub-projects, as "ant bindist" puts # other projects into the checker/build directory. -buildDirs="${cfDir}"/dataflow/build:"${cfDir}"/javacutil/build:"${cfDir}"/stubparser/build:"${cfDir}"/framework/build:"${cfDir}"/checker/build:"${annoToolsDir}"/scene-lib/bin:"${annoToolsDir}"/annotation-file-utilities/annotation-file-utilities.jar +buildDirs="${cfDir}"/dataflow/build:"${cfDir}"/javacutil/build:"${cfDir}"/framework/build:"${cfDir}"/checker/build:"${annoToolsDir}"/scene-lib/bin:"${annoToolsDir}"/annotation-file-utilities/annotation-file-utilities.jar ## Preserve quoting and spaces in arguments, which would otherwise be lost ## due to being passed through the shell twice. diff --git a/checker/build.xml b/checker/build.xml index 71fbe135c2f..850123a461a 100644 --- a/checker/build.xml +++ b/checker/build.xml @@ -207,11 +207,6 @@ - @@ -225,7 +220,7 @@ @@ -292,7 +287,7 @@ - - @@ -354,7 +348,6 @@ - @@ -366,22 +359,22 @@ + + - - - + - - - + + + @@ -1274,13 +1267,6 @@ So, use our own archived version. - - - - - - - - @@ -244,7 +226,7 @@ - + @@ -274,7 +256,7 @@ @@ -314,6 +296,7 @@ + diff --git a/framework/lib/javaparser-core.jar b/framework/lib/javaparser-core.jar new file mode 100644 index 00000000000..e36eae341d6 Binary files /dev/null and b/framework/lib/javaparser-core.jar differ diff --git a/framework/src/org/checkerframework/common/aliasing/android.astub b/framework/src/org/checkerframework/common/aliasing/android.astub index c9385719137..a2e74390589 100644 --- a/framework/src/org/checkerframework/common/aliasing/android.astub +++ b/framework/src/org/checkerframework/common/aliasing/android.astub @@ -13,41 +13,41 @@ class Intent implements Parcelable, Cloneable { @Unique Intent(Context arg0, Class arg1); @Unique Intent(String arg0, Uri arg1, Context arg2, Class arg3); - Intent addCategory(String category) @LeakedToResult; - Intent addFlags(int flags) @LeakedToResult; - Intent setType(String type) @LeakedToResult; - Intent setData(Uri data) @LeakedToResult; - Intent setComponent(ComponentName cName) @LeakedToResult; - Intent setClass(Context arg0, Class arg1) @LeakedToResult; - Intent setAction(String action) @LeakedToResult; - Intent putExtra(String arg0, boolean arg1) @LeakedToResult; - Intent putExtra(String arg0, byte arg1) @LeakedToResult; - Intent putExtra(String arg0, char arg1) @LeakedToResult; - Intent putExtra(String arg0, short arg1) @LeakedToResult; - Intent putExtra(String arg0, int arg1) @LeakedToResult; - Intent putExtra(String arg0, long arg1) @LeakedToResult; - Intent putExtra(String arg0, float arg1) @LeakedToResult; - Intent putExtra(String arg0, double arg1) @LeakedToResult; - Intent putExtra(String arg0, String arg1) @LeakedToResult; - Intent putExtra(String arg0, CharSequence arg1) @LeakedToResult; - Intent putExtra(String arg0, Parcelable arg1) @LeakedToResult; - Intent putExtra(String arg0, Parcelable[] arg1) @LeakedToResult; - Intent putParcelableArrayListExtra(String arg0, ArrayList arg1) @LeakedToResult; - Intent putIntegerArrayListExtra(String arg0, ArrayList< Integer> arg1) @LeakedToResult; - Intent putStringArrayListExtra(String arg0, ArrayList< String> arg1) @LeakedToResult; - Intent putCharSequenceArrayListExtra(String arg0, ArrayList< CharSequence> arg1) @LeakedToResult; - Intent putExtra(String arg0, Serializable arg1) @LeakedToResult; - Intent putExtra(String arg0, boolean [] arg1) @LeakedToResult; - Intent putExtra(String arg0, byte [] arg1) @LeakedToResult; - Intent putExtra(String arg0, short [] arg1) @LeakedToResult; - Intent putExtra(String arg0, char [] arg1) @LeakedToResult; - Intent putExtra(String arg0, int [] arg1) @LeakedToResult; - Intent putExtra(String arg0, long [] arg1) @LeakedToResult; - Intent putExtra(String arg0, float [] arg1) @LeakedToResult; - Intent putExtra(String arg0, double [] arg1) @LeakedToResult; - Intent putExtra(String arg0, String [] arg1) @LeakedToResult; - Intent putExtra(String arg0, CharSequence [] arg1) @LeakedToResult; - Intent putExtra(String arg0, Bundle arg1) @LeakedToResult; + Intent addCategory(@LeakedToResult Intent this, String category); + Intent addFlags(@LeakedToResult Intent this, int flags); + Intent setType(@LeakedToResult Intent this, String type); + Intent setData(@LeakedToResult Intent this, Uri data); + Intent setComponent(@LeakedToResult Intent this, ComponentName cName); + Intent setClass(@LeakedToResult Intent this, Context arg0, Class arg1); + Intent setAction(@LeakedToResult Intent this, String action); + Intent putExtra(@LeakedToResult Intent this, String arg0, boolean arg1); + Intent putExtra(@LeakedToResult Intent this, String arg0, byte arg1); + Intent putExtra(@LeakedToResult Intent this, String arg0, char arg1); + Intent putExtra(@LeakedToResult Intent this, String arg0, short arg1); + Intent putExtra(@LeakedToResult Intent this, String arg0, int arg1); + Intent putExtra(@LeakedToResult Intent this, String arg0, long arg1); + Intent putExtra(@LeakedToResult Intent this, String arg0, float arg1); + Intent putExtra(@LeakedToResult Intent this, String arg0, double arg1); + Intent putExtra(@LeakedToResult Intent this, String arg0, String arg1); + Intent putExtra(@LeakedToResult Intent this, String arg0, CharSequence arg1); + Intent putExtra(@LeakedToResult Intent this, String arg0, Parcelable arg1); + Intent putExtra(@LeakedToResult Intent this, String arg0, Parcelable[] arg1); + Intent putParcelableArrayListExtra(@LeakedToResult Intent this, String arg0, ArrayList arg1); + Intent putIntegerArrayListExtra(@LeakedToResult Intent this, String arg0, ArrayList< Integer> arg1); + Intent putStringArrayListExtra(@LeakedToResult Intent this, String arg0, ArrayList< String> arg1); + Intent putCharSequenceArrayListExtra(@LeakedToResult Intent this, String arg0, ArrayList< CharSequence> arg1); + Intent putExtra(@LeakedToResult Intent this, String arg0, Serializable arg1); + Intent putExtra(@LeakedToResult Intent this, String arg0, boolean [] arg1); + Intent putExtra(@LeakedToResult Intent this, String arg0, byte [] arg1); + Intent putExtra(@LeakedToResult Intent this, String arg0, short [] arg1); + Intent putExtra(@LeakedToResult Intent this, String arg0, char [] arg1); + Intent putExtra(@LeakedToResult Intent this, String arg0, int [] arg1); + Intent putExtra(@LeakedToResult Intent this, String arg0, long [] arg1); + Intent putExtra(@LeakedToResult Intent this, String arg0, float [] arg1); + Intent putExtra(@LeakedToResult Intent this, String arg0, double [] arg1); + Intent putExtra(@LeakedToResult Intent this, String arg0, String [] arg1); + Intent putExtra(@LeakedToResult Intent this, String arg0, CharSequence [] arg1); + Intent putExtra(@LeakedToResult Intent this, String arg0, Bundle arg1); } @@ -135,37 +135,37 @@ package android.os; class Bundle { @Unique Bundle(); - void putAll(Bundle arg0) @NonLeaked ; - void putBoolean(String arg0, boolean arg1) @NonLeaked; - void putByte(String arg0, byte arg1) @NonLeaked; - void putChar(String arg0, char arg1) @NonLeaked; - void putShort(String arg0, short arg1) @NonLeaked; - void putInt(String arg0, int arg1) @NonLeaked; - void putLong(String arg0, long arg1) @NonLeaked; - void putFloat(String arg0, float arg1) @NonLeaked; - void putDouble(String arg0, double arg1) @NonLeaked; - void putString(String arg0, String arg1) @NonLeaked; - void putCharSequence(String arg0, CharSequence arg1) @NonLeaked; - void putParcelable(String arg0, Parcelable arg1) @NonLeaked; - void putParcelableArray(String arg0, Parcelable[] arg1) @NonLeaked; - void putParcelableArrayList(String arg0, ArrayList arg1) @NonLeaked; - void putSparseParcelableArray(String arg0, SparseArray arg1) @NonLeaked; - void putIntegerArrayList(String arg0, ArrayList arg1) @NonLeaked; - void putStringArrayList(String arg0, ArrayList arg1) @NonLeaked; - void putCharSequenceArrayList(String arg0, ArrayList arg1) @NonLeaked; - void putSerializable(String arg0, Serializable arg1) @NonLeaked; - void putBooleanArray(String arg0, boolean[] arg1) @NonLeaked; - void putByteArray(String arg0, byte[] arg1) @NonLeaked; - void putShortArray(String arg0, short[] arg1) @NonLeaked; - void putCharArray(String arg0, char[] arg1) @NonLeaked; - void putIntArray(String arg0, int[] arg1) @NonLeaked; - void putLongArray(String arg0, long[] arg1) @NonLeaked; - void putFloatArray(String arg0, float[] arg1) @NonLeaked; - void putDoubleArray(String arg0, double[] arg1) @NonLeaked; - void putStringArray(String arg0, String[] arg1) @NonLeaked; - void putCharSequenceArray(String arg0, CharSequence[] arg1) @NonLeaked; - void putBundle(String arg0, Bundle arg1) @NonLeaked; - void putBinder(String arg0, IBinder arg1) @NonLeaked; + void putAll(@NonLeaked Bundle this, Bundle arg0) ; + void putBoolean(@NonLeaked Bundle this, String arg0, boolean arg1); + void putByte(@NonLeaked Bundle this, String arg0, byte arg1); + void putChar(@NonLeaked Bundle this, String arg0, char arg1); + void putShort(@NonLeaked Bundle this, String arg0, short arg1); + void putInt(@NonLeaked Bundle this, String arg0, int arg1); + void putLong(@NonLeaked Bundle this, String arg0, long arg1); + void putFloat(@NonLeaked Bundle this, String arg0, float arg1); + void putDouble(@NonLeaked Bundle this, String arg0, double arg1); + void putString(@NonLeaked Bundle this, String arg0, String arg1); + void putCharSequence(@NonLeaked Bundle this, String arg0, CharSequence arg1); + void putParcelable(@NonLeaked Bundle this, String arg0, Parcelable arg1); + void putParcelableArray(@NonLeaked Bundle this, String arg0, Parcelable[] arg1); + void putParcelableArrayList(@NonLeaked Bundle this, String arg0, ArrayList arg1); + void putSparseParcelableArray(@NonLeaked Bundle this, String arg0, SparseArray arg1); + void putIntegerArrayList(@NonLeaked Bundle this, String arg0, ArrayList arg1); + void putStringArrayList(@NonLeaked Bundle this, String arg0, ArrayList arg1); + void putCharSequenceArrayList(@NonLeaked Bundle this, String arg0, ArrayList arg1); + void putSerializable(@NonLeaked Bundle this, String arg0, Serializable arg1); + void putBooleanArray(@NonLeaked Bundle this, String arg0, boolean[] arg1); + void putByteArray(@NonLeaked Bundle this, String arg0, byte[] arg1); + void putShortArray(@NonLeaked Bundle this, String arg0, short[] arg1); + void putCharArray(@NonLeaked Bundle this, String arg0, char[] arg1); + void putIntArray(@NonLeaked Bundle this, String arg0, int[] arg1); + void putLongArray(@NonLeaked Bundle this, String arg0, long[] arg1); + void putFloatArray(@NonLeaked Bundle this, String arg0, float[] arg1); + void putDoubleArray(@NonLeaked Bundle this, String arg0, double[] arg1); + void putStringArray(@NonLeaked Bundle this, String arg0, String[] arg1); + void putCharSequenceArray(@NonLeaked Bundle this, String arg0, CharSequence[] arg1); + void putBundle(@NonLeaked Bundle this, String arg0, Bundle arg1); + void putBinder(@NonLeaked Bundle this, String arg0, IBinder arg1); /** boolean getBoolean(String arg0); boolean getBoolean(String arg0, boolean arg1); diff --git a/framework/src/org/checkerframework/common/basetype/flow.astub b/framework/src/org/checkerframework/common/basetype/flow.astub index 3f00c300587..e025ee899e7 100644 --- a/framework/src/org/checkerframework/common/basetype/flow.astub +++ b/framework/src/org/checkerframework/common/basetype/flow.astub @@ -98,24 +98,25 @@ public final class Character { @Pure public static int compare(char x, char y); @Pure public static char reverseBytes(char ch); @Pure public static String getName(int codePoint); -} -public static class Character$Subset { - @Pure protected Subset(String name); - @Pure public final boolean equals(Object obj); - @Pure public final int hashCode(); - @SideEffectFree public final String toString(); -} -public static final class Character$UnicodeBlock { - @Pure public static UnicodeBlock of(char c); - @Pure public static UnicodeBlock of(int codePoint); - @Pure public static final UnicodeBlock forName(String blockName); + public static class Subset { + @Pure protected Subset(String name); + @Pure public final boolean equals(Object obj); + @Pure public final int hashCode(); + @SideEffectFree public final String toString(); + } + public static final class UnicodeBlock { + @Pure public static UnicodeBlock of(char c); + @Pure public static UnicodeBlock of(int codePoint); + @Pure public static final UnicodeBlock forName(String blockName); + } + public static enum UnicodeScript { + // At least one enum constant should be declared in a stub file. + COMMON; + @Pure public static UnicodeScript of(int codePoint); + @Pure public static final UnicodeScript forName(String scriptName); + } } -// Stub file parser bug? Can it handle enums? -// public static enum Character$UnicodeScript { -// @Pure public static UnicodeScript of(int codePoint); -// @Pure public static final UnicodeScript forName(String scriptName); -// } public class Object { @Pure public Object(); diff --git a/framework/src/org/checkerframework/common/value/statically-executable.astub b/framework/src/org/checkerframework/common/value/statically-executable.astub index 275cfb67950..56dec4e967c 100644 --- a/framework/src/org/checkerframework/common/value/statically-executable.astub +++ b/framework/src/org/checkerframework/common/value/statically-executable.astub @@ -18,15 +18,15 @@ class Byte{ @StaticallyExecutable Byte(byte value); @StaticallyExecutable Byte(String s); - @StaticallyExecutable @PolyValue byte byteValue() @PolyValue; + @StaticallyExecutable @PolyValue byte byteValue(@PolyValue Byte this); @StaticallyExecutable static Byte decode(String nm); - @StaticallyExecutable @PolyValue double doubleValue() @PolyValue; - @StaticallyExecutable @PolyValue float floatValue() @PolyValue; - @StaticallyExecutable @PolyValue int intValue() @PolyValue; - @StaticallyExecutable @PolyValue long longValue() @PolyValue; + @StaticallyExecutable @PolyValue double doubleValue(@PolyValue Byte this); + @StaticallyExecutable @PolyValue float floatValue(@PolyValue Byte this); + @StaticallyExecutable @PolyValue int intValue(@PolyValue Byte this); + @StaticallyExecutable @PolyValue long longValue(@PolyValue Byte this); @StaticallyExecutable static byte parseByte(String s); @StaticallyExecutable static byte parseByte(String s, int radix); - @StaticallyExecutable @PolyValue short shortValue() @PolyValue; + @StaticallyExecutable @PolyValue short shortValue(@PolyValue Byte this); @StaticallyExecutable @ArrayLen({1,2,3,4}) String toString(); @StaticallyExecutable static @ArrayLen({1,2,3,4}) String toString(byte b); @StaticallyExecutable static @PolyValue Byte valueOf(@PolyValue byte b); @@ -117,21 +117,21 @@ class Double{ @StaticallyExecutable Double(double value); @StaticallyExecutable Double(String s); - @StaticallyExecutable @PolyValue byte byteValue() @PolyValue; + @StaticallyExecutable @PolyValue byte byteValue(@PolyValue Double this); @StaticallyExecutable static int compare(double d1, double d2); @StaticallyExecutable static long doubleToLongBits(double value); @StaticallyExecutable static long doubleToRawLongBits(double value); - @StaticallyExecutable @PolyValue double doubleValue() @PolyValue; - @StaticallyExecutable @PolyValue float floatValue() @PolyValue; - @StaticallyExecutable @PolyValue int intValue() @PolyValue; + @StaticallyExecutable @PolyValue double doubleValue(@PolyValue Double this); + @StaticallyExecutable @PolyValue float floatValue(@PolyValue Double this); + @StaticallyExecutable @PolyValue int intValue(@PolyValue Double this); @StaticallyExecutable boolean isInfinite(); @StaticallyExecutable static boolean isInfinite(double v); @StaticallyExecutable boolean isNaN(); @StaticallyExecutable static boolean isNaN(double v); @StaticallyExecutable static double longBitsToDouble(long bits); - @StaticallyExecutable @PolyValue long longValue() @PolyValue; + @StaticallyExecutable @PolyValue long longValue(@PolyValue Double this); @StaticallyExecutable static double parseDouble(String s); - @StaticallyExecutable @PolyValue short shortValue() @PolyValue; + @StaticallyExecutable @PolyValue short shortValue(@PolyValue Double this); @StaticallyExecutable static String toHexString(double d); @StaticallyExecutable String toString(); @StaticallyExecutable static String toString(double d); @@ -143,21 +143,21 @@ class Float{ @StaticallyExecutable Float(float value); @StaticallyExecutable Float(String s); - @StaticallyExecutable @PolyValue byte byteValue() @PolyValue; + @StaticallyExecutable @PolyValue byte byteValue(@PolyValue Float this); @StaticallyExecutable static int compare(float f1, float f2); - @StaticallyExecutable @PolyValue double doubleValue() @PolyValue; + @StaticallyExecutable @PolyValue double doubleValue(@PolyValue Float this); @StaticallyExecutable static int floatToIntBits(float value); @StaticallyExecutable static int floatToRawIntBits(float value); - @StaticallyExecutable @PolyValue float floatValue() @PolyValue; + @StaticallyExecutable @PolyValue float floatValue(@PolyValue Float this); @StaticallyExecutable static float intBitsToFloat(int bits); - @StaticallyExecutable @PolyValue int intValue() @PolyValue; + @StaticallyExecutable @PolyValue int intValue(@PolyValue Float this); @StaticallyExecutable boolean isInfinite(); @StaticallyExecutable static boolean isInfinite(float v); @StaticallyExecutable boolean isNaN(); @StaticallyExecutable static boolean isNaN(float v); - @StaticallyExecutable @PolyValue long longValue() @PolyValue; + @StaticallyExecutable @PolyValue long longValue(@PolyValue Float this); @StaticallyExecutable static float parseFloat(String s); - @StaticallyExecutable @PolyValue short shortValue() @PolyValue; + @StaticallyExecutable @PolyValue short shortValue(@PolyValue Float this); @StaticallyExecutable static String toHexString(float f); @StaticallyExecutable String toString(); @StaticallyExecutable static String toString(float f); @@ -170,16 +170,16 @@ class Integer{ @StaticallyExecutable Integer(String s); @StaticallyExecutable static int bitCount(int i); - @StaticallyExecutable @PolyValue byte byteValue() @PolyValue; + @StaticallyExecutable @PolyValue byte byteValue(@PolyValue Integer this); @StaticallyExecutable static Integer decode(String nm); - @StaticallyExecutable @PolyValue double doubleValue() @PolyValue; - @StaticallyExecutable @PolyValue float floatValue() @PolyValue; + @StaticallyExecutable @PolyValue double doubleValue(@PolyValue Integer this); + @StaticallyExecutable @PolyValue float floatValue(@PolyValue Integer this); @StaticallyExecutable static Integer getInteger(String nm); @StaticallyExecutable static Integer getInteger(String nm, int val); @StaticallyExecutable static Integer getInteger(String nm, Integer val); @StaticallyExecutable static int highestOneBit(int i); - @StaticallyExecutable @PolyValue int intValue() @PolyValue; - @StaticallyExecutable @PolyValue long longValue() @PolyValue; + @StaticallyExecutable @PolyValue int intValue(@PolyValue Integer this); + @StaticallyExecutable @PolyValue long longValue(@PolyValue Integer this); @StaticallyExecutable static int lowestOneBit(int i); @StaticallyExecutable static int numberOfLeadingZeros(int i); @StaticallyExecutable static int numberOfTrailingZeros(int i); @@ -207,16 +207,16 @@ class Long{ @StaticallyExecutable Long(String s); @StaticallyExecutable static int bitCount(long i); - @StaticallyExecutable @PolyValue byte byteValue() @PolyValue; + @StaticallyExecutable @PolyValue byte byteValue(@PolyValue Long this); @StaticallyExecutable static Long decode(String nm); - @StaticallyExecutable @PolyValue double doubleValue() @PolyValue; - @StaticallyExecutable @PolyValue float floatValue() @PolyValue; + @StaticallyExecutable @PolyValue double doubleValue(@PolyValue Long this); + @StaticallyExecutable @PolyValue float floatValue(@PolyValue Long this); @StaticallyExecutable static Long getLong(String nm); @StaticallyExecutable static Long getLong(String nm, long val); @StaticallyExecutable static Long getLong(String nm, Long val); @StaticallyExecutable static long highestOneBit(long i); - @StaticallyExecutable @PolyValue int intValue() @PolyValue; - @StaticallyExecutable @PolyValue long longValue() @PolyValue; + @StaticallyExecutable @PolyValue int intValue(@PolyValue Long this); + @StaticallyExecutable @PolyValue long longValue(@PolyValue Long this); @StaticallyExecutable static long lowestOneBit(long i); @StaticallyExecutable static int numberOfLeadingZeros(long i); @StaticallyExecutable static int numberOfTrailingZeros(long i); @@ -226,7 +226,7 @@ class Long{ @StaticallyExecutable static long reverseBytes(long i); @StaticallyExecutable static long rotateLeft(long i, int distance); @StaticallyExecutable static long rotateRight(long i, int distance); - @StaticallyExecutable @PolyValue short shortValue() @PolyValue; + @StaticallyExecutable @PolyValue short shortValue(@PolyValue Long this); @StaticallyExecutable static int signum(long i); @StaticallyExecutable static @ArrayLenRange(from = 1, to = 64) String toBinaryString(long i); @StaticallyExecutable static @ArrayLenRange(from = 1, to = 16) String toHexString(long i); @@ -243,16 +243,16 @@ class Short{ @StaticallyExecutable Short(short value); @StaticallyExecutable Short(String s); - @StaticallyExecutable @PolyValue byte byteValue() @PolyValue; + @StaticallyExecutable @PolyValue byte byteValue(@PolyValue Short this); @StaticallyExecutable static Short decode(String nm); - @StaticallyExecutable @PolyValue double doubleValue() @PolyValue; - @StaticallyExecutable @PolyValue float floatValue() @PolyValue; - @StaticallyExecutable @PolyValue int intValue() @PolyValue; - @StaticallyExecutable @PolyValue long longValue() @PolyValue; + @StaticallyExecutable @PolyValue double doubleValue(@PolyValue Short this); + @StaticallyExecutable @PolyValue float floatValue(@PolyValue Short this); + @StaticallyExecutable @PolyValue int intValue(@PolyValue Short this); + @StaticallyExecutable @PolyValue long longValue(@PolyValue Short this); @StaticallyExecutable static short parseShort(String s); @StaticallyExecutable static short parseShort(String s, int radix); @StaticallyExecutable static short reverseBytes(short i); - @StaticallyExecutable @PolyValue short shortValue() @PolyValue; + @StaticallyExecutable @PolyValue short shortValue(@PolyValue Short this); @StaticallyExecutable @ArrayLen({1, 2, 3, 4, 5, 6}) String toString(); @StaticallyExecutable static @ArrayLen({1, 2, 3, 4, 5, 6}) String toString(short s); @StaticallyExecutable static @PolyValue Short valueOf(@PolyValue short s); diff --git a/framework/src/org/checkerframework/framework/stub/StubParser.java b/framework/src/org/checkerframework/framework/stub/StubParser.java index 26d7927b255..347498c0187 100644 --- a/framework/src/org/checkerframework/framework/stub/StubParser.java +++ b/framework/src/org/checkerframework/framework/stub/StubParser.java @@ -4,6 +4,31 @@ import org.checkerframework.checker.nullness.qual.*; */ +import com.github.javaparser.JavaParser; +import com.github.javaparser.ParseProblemException; +import com.github.javaparser.ast.*; +import com.github.javaparser.ast.body.BodyDeclaration; +import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; +import com.github.javaparser.ast.body.ConstructorDeclaration; +import com.github.javaparser.ast.body.EnumDeclaration; +import com.github.javaparser.ast.body.FieldDeclaration; +import com.github.javaparser.ast.body.MethodDeclaration; +import com.github.javaparser.ast.body.Parameter; +import com.github.javaparser.ast.body.TypeDeclaration; +import com.github.javaparser.ast.body.VariableDeclarator; +import com.github.javaparser.ast.expr.AnnotationExpr; +import com.github.javaparser.ast.expr.ArrayInitializerExpr; +import com.github.javaparser.ast.expr.BooleanLiteralExpr; +import com.github.javaparser.ast.expr.Expression; +import com.github.javaparser.ast.expr.FieldAccessExpr; +import com.github.javaparser.ast.expr.IntegerLiteralExpr; +import com.github.javaparser.ast.expr.MarkerAnnotationExpr; +import com.github.javaparser.ast.expr.MemberValuePair; +import com.github.javaparser.ast.expr.NameExpr; +import com.github.javaparser.ast.expr.NormalAnnotationExpr; +import com.github.javaparser.ast.expr.SingleMemberAnnotationExpr; +import com.github.javaparser.ast.expr.StringLiteralExpr; +import com.github.javaparser.ast.type.*; import java.io.InputStream; import java.util.ArrayList; import java.util.HashMap; @@ -39,36 +64,6 @@ import org.checkerframework.javacutil.ErrorReporter; import org.checkerframework.javacutil.Pair; import org.checkerframework.javacutil.TypesUtils; -import org.checkerframework.stubparser.JavaParser; -import org.checkerframework.stubparser.ast.CompilationUnit; -import org.checkerframework.stubparser.ast.ImportDeclaration; -import org.checkerframework.stubparser.ast.IndexUnit; -import org.checkerframework.stubparser.ast.PackageDeclaration; -import org.checkerframework.stubparser.ast.TypeParameter; -import org.checkerframework.stubparser.ast.body.BodyDeclaration; -import org.checkerframework.stubparser.ast.body.ClassOrInterfaceDeclaration; -import org.checkerframework.stubparser.ast.body.ConstructorDeclaration; -import org.checkerframework.stubparser.ast.body.FieldDeclaration; -import org.checkerframework.stubparser.ast.body.MethodDeclaration; -import org.checkerframework.stubparser.ast.body.Parameter; -import org.checkerframework.stubparser.ast.body.TypeDeclaration; -import org.checkerframework.stubparser.ast.body.VariableDeclarator; -import org.checkerframework.stubparser.ast.expr.AnnotationExpr; -import org.checkerframework.stubparser.ast.expr.ArrayInitializerExpr; -import org.checkerframework.stubparser.ast.expr.BooleanLiteralExpr; -import org.checkerframework.stubparser.ast.expr.Expression; -import org.checkerframework.stubparser.ast.expr.FieldAccessExpr; -import org.checkerframework.stubparser.ast.expr.IntegerLiteralExpr; -import org.checkerframework.stubparser.ast.expr.MarkerAnnotationExpr; -import org.checkerframework.stubparser.ast.expr.MemberValuePair; -import org.checkerframework.stubparser.ast.expr.NameExpr; -import org.checkerframework.stubparser.ast.expr.NormalAnnotationExpr; -import org.checkerframework.stubparser.ast.expr.SingleMemberAnnotationExpr; -import org.checkerframework.stubparser.ast.expr.StringLiteralExpr; -import org.checkerframework.stubparser.ast.type.ClassOrInterfaceType; -import org.checkerframework.stubparser.ast.type.ReferenceType; -import org.checkerframework.stubparser.ast.type.Type; -import org.checkerframework.stubparser.ast.type.WildcardType; /** Main entry point is: {@link StubParser#parse(Map, Map)} */ // Full entry point signature: @@ -88,10 +83,14 @@ public class StubParser { private final boolean debugStubParser; + // TODO: filename is the simple "jdk.astub" and "flow.astub" for those pre-defined files, + // without complete path, but the full path in other situations. + // All invocations should provide the short path or the full path. + // For testing it is easier if only the file name is used. /** The file being parsed (makes error messages more informative). */ private final String filename; - private final IndexUnit index; + private final StubUnit stubUnit; private final ProcessingEnvironment processingEnv; private final AnnotatedTypeFactory atypeFactory; private final Elements elements; @@ -150,17 +149,25 @@ public StubParser( this.debugStubParser = options.containsKey("stubDebug"); if (debugStubParser) { - stubDebug(String.format("parsing stub file %s%n", filename)); + stubDebug(String.format("parsing stub file %s", filename)); } - IndexUnit parsedindex; + StubUnit parsedStubUnit; try { - parsedindex = JavaParser.parse(inputStream); + parsedStubUnit = JavaParser.parseStubUnit(inputStream); + } catch (ParseProblemException e) { + ErrorReporter.errorAbort( + "StubParser: exception from StubParser.parse for file " + + filename + + "\n" + + "Problem message with problems encountered: " + + e.getMessage()); + parsedStubUnit = null; // dead code, but needed for definite assignment checks } catch (Exception e) { ErrorReporter.errorAbort( - "StubParser: exception from JavaParser.parse for file " + filename, e); - parsedindex = null; // dead code, but needed for def. assignment checks + "StubParser: exception from StubParser.parse for file " + filename, e); + parsedStubUnit = null; // dead code, but needed for definite assignment checks } - this.index = parsedindex; + this.stubUnit = parsedStubUnit; // getSupportedAnnotations also sets imports. This should be refactored to be nicer. supportedAnnotations = getSupportedAnnotations(); @@ -228,8 +235,8 @@ private static List getImportableMembers(TypeElement typeElement) { /** @see #supportedAnnotations */ private Map getSupportedAnnotations() { - assert !index.getCompilationUnits().isEmpty(); - CompilationUnit cu = index.getCompilationUnits().get(0); + assert !stubUnit.getCompilationUnits().isEmpty(); + CompilationUnit cu = stubUnit.getCompilationUnits().get(0); Map result = new HashMap(); @@ -315,11 +322,11 @@ private Map getSupportedAnnotations() { public void parse( Map atypes, Map> declAnnos) { - parse(this.index, atypes, declAnnos); + parse(this.stubUnit, atypes, declAnnos); } private void parse( - IndexUnit index, + StubUnit index, Map atypes, Map> declAnnos) { for (CompilationUnit cu : index.getCompilationUnits()) { @@ -337,17 +344,17 @@ private void parse( final String packageName; final List packageAnnos; - if (cu.getPackage() == null) { + if (!cu.getPackageDeclaration().isPresent()) { packageName = null; packageAnnos = null; } else { - packageName = cu.getPackage().getName().toString(); - packageAnnos = cu.getPackage().getAnnotations(); - parsePackage(cu.getPackage(), atypes, declAnnos); + packageName = cu.getPackageDeclaration().get().getNameAsString(); + packageAnnos = cu.getPackageDeclaration().get().getAnnotations(); + parsePackage(cu.getPackageDeclaration().get(), atypes, declAnnos); } if (cu.getTypes() != null) { - for (TypeDeclaration typeDecl : cu.getTypes()) { - parse(typeDecl, packageName, packageAnnos, atypes, declAnnos); + for (TypeDeclaration typeDeclaration : cu.getTypes()) { + parse(typeDeclaration, packageName, packageAnnos, atypes, declAnnos); } } } @@ -367,32 +374,28 @@ private void parsePackage( // TODO: Handle atypes??? } - // typeDecl's name may be a binary name such as "A$B". - // That is a hack because the StubParser does not handle nested classes. private void parse( - TypeDeclaration typeDecl, + TypeDeclaration typeDecl, String packageName, List packageAnnos, Map atypes, Map> declAnnos) { // Fully-qualified name of the type being parsed String typeName = - (packageName == null ? "" : packageName + ".") - + typeDecl.getName().replace('$', '.'); + (packageName == null ? "" : packageName + ".") + typeDecl.getNameAsString(); TypeElement typeElt = elements.getTypeElement(typeName); - // couldn't find type. not in class path if (typeElt == null) { boolean warn = true; if (typeDecl.getAnnotations() != null) { for (AnnotationExpr anno : typeDecl.getAnnotations()) { - if (anno.getName().getName().contentEquals("NoStubParserWarning")) { + if (anno.getNameAsString().contentEquals("NoStubParserWarning")) { warn = false; } } } if (packageAnnos != null) { for (AnnotationExpr anno : packageAnnos) { - if (anno.getName().getName().contentEquals("NoStubParserWarning")) { + if (anno.getNameAsString().contentEquals("NoStubParserWarning")) { warn = false; } } @@ -405,7 +408,8 @@ private void parse( } if (typeElt.getKind() == ElementKind.ENUM) { - stubWarnIfNotFound("Skipping enum type: " + typeName); + typeParameters.addAll( + parseEnum((EnumDeclaration) typeDecl, typeElt, atypes, declAnnos)); } else if (typeElt.getKind() == ElementKind.ANNOTATION_TYPE) { stubWarnIfNotFound("Skipping annotation type: " + typeName); } else if (typeDecl instanceof ClassOrInterfaceDeclaration) { @@ -413,20 +417,42 @@ private void parse( parseType((ClassOrInterfaceDeclaration) typeDecl, typeElt, atypes, declAnnos)); } // else it's an EmptyTypeDeclaration. TODO: An EmptyTypeDeclaration can have annotations, right? - Map elementsToDecl = getMembers(typeElt, typeDecl); - for (Map.Entry entry : elementsToDecl.entrySet()) { + Map> elementsToDecl = getMembers(typeElt, typeDecl); + for (Map.Entry> entry : elementsToDecl.entrySet()) { final Element elt = entry.getKey(); - final BodyDeclaration decl = entry.getValue(); - if (elt.getKind().isField()) { - parseField((FieldDeclaration) decl, (VariableElement) elt, atypes, declAnnos); - } else if (elt.getKind() == ElementKind.CONSTRUCTOR) { - parseConstructor( - (ConstructorDeclaration) decl, (ExecutableElement) elt, atypes, declAnnos); - } else if (elt.getKind() == ElementKind.METHOD) { - parseMethod((MethodDeclaration) decl, (ExecutableElement) elt, atypes, declAnnos); - } else { - /* do nothing */ - stubWarnIfNotFound("StubParser ignoring: " + elt); + final BodyDeclaration decl = entry.getValue(); + switch (elt.getKind()) { + case FIELD: + case ENUM_CONSTANT: + parseField((FieldDeclaration) decl, (VariableElement) elt, atypes, declAnnos); + break; + case CONSTRUCTOR: + parseConstructor( + (ConstructorDeclaration) decl, + (ExecutableElement) elt, + atypes, + declAnnos); + break; + case METHOD: + parseMethod( + (MethodDeclaration) decl, (ExecutableElement) elt, atypes, declAnnos); + break; + case CLASS: + case INTERFACE: + parse( + (ClassOrInterfaceDeclaration) decl, + typeName, + packageAnnos, + atypes, + declAnnos); + break; + case ENUM: + parse((EnumDeclaration) decl, typeName, packageAnnos, atypes, declAnnos); + break; + default: + /* do nothing */ + stubWarnIfNotFound("StubParser ignoring: " + elt); + break; } } typeParameters.clear(); @@ -450,66 +476,70 @@ private List parseType( // throw new Error(String.format("parseType (%s, %s): inconsistent nullness for args and params%n args = %s%n params = %s%n", decl, elt, typeArguments, typeParameters)); // } - if ((typeParameters == null) && (typeArguments.size() != 0)) { - // TODO: Class EventListenerProxy in Java 6 does not have type parameters, but in Java 7 does. - // To handle both with one specification, we currently ignore the problem. - // Investigate what a cleaner solution is, e.g. having a separate Java 7 specification that overrides - // the Java 6 specification. - // System.out.printf("Dying. theCompilationUnit=%s%n", theCompilationUnit); - if (debugStubParser) { + if (debugStubParser) { + int numParams = (typeParameters == null ? 0 : typeParameters.size()); + int numArgs = (typeArguments == null ? 0 : typeArguments.size()); + if (numParams != numArgs) { stubDebug( String.format( - "parseType: mismatched sizes for params and args%n decl=%s%n typeParameters=%s%n elt=%s (%s)%n type=%s (%s)%n typeArguments (size %d)=%s%n theCompilationUnit=%s%nEnd of message for parseType: mismatched sizes for params and args%n", - decl, + "parseType: mismatched sizes for typeParameters=%s (size %d) and typeArguments=%s (size %d); decl=%s; elt=%s (%s); type=%s (%s); theCompilationUnit=%s", typeParameters, - elt, + numParams, + typeArguments, + numArgs, + decl.toString().replace(LINE_SEPARATOR, " "), + elt.toString().replace(LINE_SEPARATOR, " "), elt.getClass(), type, type.getClass(), - typeArguments.size(), - typeArguments, theCompilationUnit)); } - /* - throw new Error(String.format("parseType: mismatched sizes for params and args%n decl=%s%n typeParameters=%s%n elt=%s (%s)%n type=%s (%s)%n typeArguments (size %d)=%s%n", - decl, typeParameters, - elt, elt.getClass(), type, type.getClass(), typeArguments.size(), typeArguments)); - */ } - if ((typeParameters != null) && (typeParameters.size() != typeArguments.size())) { - // TODO: decide how severe this problem really is; see comment above. - // System.out.printf("Dying. theCompilationUnit=%s%n", theCompilationUnit); - if (debugStubParser) { - stubDebug( - String.format( - "parseType: mismatched sizes for params and args%n decl=%s%n typeParameters (size %d)=%s%n elt=%s (%s)%n type=%s (%s)%n typeArguments (size %d)=%s%n theCompilationUnit=%s%nEnd of message for parseType: mismatched sizes for params and args%n", - decl, - typeParameters.size(), - typeParameters, - elt, - elt.getClass(), - type, - type.getClass(), - typeArguments.size(), - typeArguments, - theCompilationUnit)); + annotateTypeParameters(decl, elt, atypes, typeArguments, typeParameters); + annotateSupertypes(decl, type); + putNew(atypes, elt, type); + List typeVariables = new ArrayList<>(); + for (AnnotatedTypeMirror typeV : type.getTypeArguments()) { + if (typeV.getKind() != TypeKind.TYPEVAR) { + stubAlwaysWarn( + "Expected an AnnotatedTypeVariable but found type kind " + + typeV.getKind() + + ": " + + typeV); + } else { + typeVariables.add((AnnotatedTypeVariable) typeV); } - /* - throw new Error(String.format("parseType: mismatched sizes for params and args%n decl=%s%n typeParameters (size %d)=%s%n elt=%s (%s)%n type=%s (%s)%n typeArguments (size %d)=%s%n", - decl, typeParameters.size(), typeParameters, - elt, elt.getClass(), type, type.getClass(), typeArguments.size(), typeArguments)); - */ } + return typeVariables; + } + + /** + * Gathers and returns a list of AnnotatedTypeVariable of the enum's type parameter + * declarations. + * + * @param decl actual enum declaration + * @param elt element representing enum + * @param atypes map of annotated types + * @param declAnnos map of declarations annotations + * @return list of AnnotatedTypeVariable of the enum's type parameter declarations + */ + private List parseEnum( + EnumDeclaration decl, + TypeElement elt, + Map atypes, + Map> declAnnos) { + + annotateDecl(declAnnos, elt, decl.getAnnotations()); + AnnotatedDeclaredType type = atypeFactory.fromElement(elt); + annotate(type, decl.getAnnotations()); - annotateTypeParameters(atypes, typeArguments, typeParameters); - annotateSupertypes(decl, type); putNew(atypes, elt, type); List typeVariables = new ArrayList<>(); for (AnnotatedTypeMirror typeV : type.getTypeArguments()) { if (typeV.getKind() != TypeKind.TYPEVAR) { stubAlwaysWarn( - "Expected an AnnotatedTypeVariable but found type kind" + "Expected an AnnotatedTypeVariable but found type kind " + typeV.getKind() + ": " + typeV); @@ -522,8 +552,8 @@ private List parseType( private void annotateSupertypes( ClassOrInterfaceDeclaration typeDecl, AnnotatedDeclaredType type) { - if (typeDecl.getExtends() != null) { - for (ClassOrInterfaceType superType : typeDecl.getExtends()) { + if (typeDecl.getExtendedTypes() != null) { + for (ClassOrInterfaceType superType : typeDecl.getExtendedTypes()) { AnnotatedDeclaredType foundType = findType(superType, type.directSuperTypes()); assert foundType != null : "StubParser: could not find superclass " @@ -536,8 +566,8 @@ private void annotateSupertypes( } } } - if (typeDecl.getImplements() != null) { - for (ClassOrInterfaceType superType : typeDecl.getImplements()) { + if (typeDecl.getImplementedTypes() != null) { + for (ClassOrInterfaceType superType : typeDecl.getImplementedTypes()) { AnnotatedDeclaredType foundType = findType(superType, type.directSuperTypes()); // TODO: Java 7 added a few AutoCloseable superinterfaces to classes. // We specify those as superinterfaces in the jdk.astub file. Let's ignore @@ -563,13 +593,19 @@ private void parseMethod( ExecutableElement elt, Map atypes, Map> declAnnos) { + // Switch annotations between method declaration and type. + NodeList list = decl.getType().getAnnotations(); + decl.getType().setAnnotations(decl.getAnnotations()); + decl.setAnnotations(list); + annotateDecl(declAnnos, elt, decl.getAnnotations()); // StubParser parses all annotations in type annotation position as type annotations annotateDecl(declAnnos, elt, decl.getType().getAnnotations()); addDeclAnnotations(declAnnos, elt); AnnotatedExecutableType methodType = atypeFactory.fromElement(elt); - annotateTypeParameters(atypes, methodType.getTypeVariables(), decl.getTypeParameters()); + annotateTypeParameters( + decl, elt, atypes, methodType.getTypeVariables(), decl.getTypeParameters()); typeParameters.addAll(methodType.getTypeVariables()); annotate(methodType.getReturnType(), decl.getType()); @@ -585,6 +621,9 @@ private void parseMethod( annotateDecl(declAnnos, paramElt, param.getAnnotations()); annotateDecl(declAnnos, paramElt, param.getType().getAnnotations()); + // Duplicate parameter annotations to the type. + param.getType().setAnnotations(param.getAnnotations()); + if (param.isVarArgs()) { // workaround assert paramType.getKind() == TypeKind.ARRAY; @@ -612,33 +651,34 @@ private void parseMethod( } /** - * Handle existing annotations on the type. Stub files should override the existing annotations - * on a type. Using {@code replaceAnnotation} is usually good enough to achieve this; however, - * for annotations on type variables, the stub file sometimes needs to be able to remove an - * existing annotation, leaving no annotation on the type variable. This method achieves this by - * calling {@code clearAnnotations}. + * Handle existing annotations on the type, by removing them. + * + *

Stub files should override the existing annotations on a type. Using {@code + * replaceAnnotation} is usually good enough to achieve this; however, for annotations on type + * variables, the stub file sometimes needs to be able to remove an existing annotation, leaving + * no annotation on the type variable. This method achieves this by calling {@code + * clearAnnotations}. * * @param atype the type to modify * @param typeDef the type from the stub file, for warnings */ private void handleExistingAnnotations(AnnotatedTypeMirror atype, Type typeDef) { Set annos = atype.getAnnotations(); + // TODO: instead of comparison against flow.astub, this should + // check whether the stub file is @AnnotatedFor the current type system. + // flow.astub isn't annotated for any particular type system, so let's + // not warn for now, as @AnnotatedFor isn't integrated in stub files yet. if (annos != null && !annos.isEmpty() && !"flow.astub".equals(filename)) { - // TODO: instead of comparison against flow.astub, this should - // check whether the stub file is @AnnotatedFor the current type system. - // flow.astub isn't annotated for any particular type system, so let's - // not warn for now, as @AnnotatedFor isn't integrated in stub files yet. - stubWarnIfOverwritesBytecode( - String.format( - "in file %s at line %s ignored existing annotations on type: %s%n", - filename.substring(filename.lastIndexOf('/') + 1), - typeDef.getBeginLine(), - atype.toString(true))); - // TODO: filename is the simple "jdk.astub" and "flow.astub" for those pre-defined files, - // without complete path, but the full path in other situations. - // All invocations should provide the short path or the full path. - // For testing it is easier if only the file name is used. - + // TODO: only produce output if the removed annotation is interesting. + // Probably that means it isn't the top and default annotation in the type hierarchy. + if (false) { // disable for now, because the output is boring and verbose + stubWarnIfOverwritesBytecode( + String.format( + "in file %s at line %s removed existing annotations on type: %s", + filename.substring(filename.lastIndexOf('/') + 1), + typeDef.getBegin().get().line, + atype.toString(true))); + } // Clear existing annotations, which only makes a difference for // type variables, but doesn't hurt in other cases. atype.clearAnnotations(); @@ -676,13 +716,13 @@ private List arrayAllComponents(AnnotatedArrayType atype) { private void annotateAsArray(AnnotatedArrayType atype, ReferenceType typeDef) { List arrayTypes = arrayAllComponents(atype); - assert typeDef.getArrayCount() == arrayTypes.size() - 1 + assert typeDef.getArrayLevel() == arrayTypes.size() - 1 || // We want to allow simply using "Object" as return type of a // method, regardless of what the real type is. - typeDef.getArrayCount() == 0 + typeDef.getArrayLevel() == 0 : "Mismatched array lengths; typeDef: " - + typeDef.getArrayCount() + + typeDef.getArrayLevel() + " vs. arrayTypes: " + (arrayTypes.size() - 1) + "\n typedef: " @@ -711,8 +751,8 @@ private void annotateAsArray(AnnotatedArrayType atype, ReferenceType typeDef) { private ClassOrInterfaceType unwrapDeclaredType(Type type) { if (type instanceof ClassOrInterfaceType) { return (ClassOrInterfaceType) type; - } else if (type instanceof ReferenceType && ((ReferenceType) type).getArrayCount() == 0) { - return unwrapDeclaredType(((ReferenceType) type).getType()); + } else if (type instanceof ReferenceType && type.getArrayLevel() == 0) { + return unwrapDeclaredType(type.getElementType()); } else { return null; } @@ -729,28 +769,31 @@ private void annotate(AnnotatedTypeMirror atype, Type typeDef) { ClassOrInterfaceType declType = unwrapDeclaredType(typeDef); if (atype.getKind() == TypeKind.DECLARED && declType != null) { AnnotatedDeclaredType adeclType = (AnnotatedDeclaredType) atype; - if (declType.getTypeArgs() != null - && !declType.getTypeArgs().isEmpty() + if (declType.getTypeArguments().isPresent() + && !declType.getTypeArguments().get().isEmpty() && !adeclType.getTypeArguments().isEmpty()) { - assert declType.getTypeArgs().size() == adeclType.getTypeArguments().size() + assert declType.getTypeArguments().get().size() + == adeclType.getTypeArguments().size() : String.format( "Mismatch in type argument size between %s (%d) and %s (%d)", declType, - declType.getTypeArgs().size(), + declType.getTypeArguments().get().size(), adeclType, adeclType.getTypeArguments().size()); - for (int i = 0; i < declType.getTypeArgs().size(); ++i) { - annotate(adeclType.getTypeArguments().get(i), declType.getTypeArgs().get(i)); + for (int i = 0; i < declType.getTypeArguments().get().size(); ++i) { + annotate( + adeclType.getTypeArguments().get(i), + declType.getTypeArguments().get().get(i)); } } } else if (atype.getKind() == TypeKind.WILDCARD) { AnnotatedWildcardType wildcardType = (AnnotatedWildcardType) atype; WildcardType wildcardDef = (WildcardType) typeDef; - if (wildcardDef.getExtends() != null) { - annotate(wildcardType.getExtendsBound(), wildcardDef.getExtends()); + if (wildcardDef.getExtendedType().isPresent()) { + annotate(wildcardType.getExtendsBound(), wildcardDef.getExtendedType().get()); annotate(wildcardType.getSuperBound(), typeDef.getAnnotations()); - } else if (wildcardDef.getSuper() != null) { - annotate(wildcardType.getSuperBound(), wildcardDef.getSuper()); + } else if (wildcardDef.getSuperType().isPresent()) { + annotate(wildcardType.getSuperBound(), wildcardDef.getSuperType().get()); annotate(wildcardType.getExtendsBound(), typeDef.getAnnotations()); } else { annotate(atype, typeDef.getAnnotations()); @@ -783,6 +826,9 @@ private void parseConstructor( for (int i = 0; i < methodType.getParameterTypes().size(); ++i) { AnnotatedTypeMirror paramType = methodType.getParameterTypes().get(i); Parameter param = decl.getParameters().get(i); + if (param.getAnnotations() != null) { + param.getType().setAnnotations(param.getAnnotations()); + } annotate(paramType, param.getType()); } @@ -810,9 +856,9 @@ private void parseField( addDeclAnnotations(declAnnos, elt); annotateDecl(declAnnos, elt, decl.getAnnotations()); // StubParser parses all annotations in type annotation position as type annotations - annotateDecl(declAnnos, elt, decl.getType().getAnnotations()); + annotateDecl(declAnnos, elt, decl.getElementType().getAnnotations()); AnnotatedTypeMirror fieldType = atypeFactory.fromElement(elt); - annotate(fieldType, decl.getType()); + annotate(fieldType, decl.getElementType()); putNew(atypes, elt, fieldType); } @@ -847,6 +893,8 @@ private void annotateDecl( } private void annotateTypeParameters( + BodyDeclaration decl, // for debugging + Object elt, // for debugging; TypeElement or ExecutableElement Map atypes, List typeArguments, List typeParameters) { @@ -857,11 +905,14 @@ private void annotateTypeParameters( if (typeParameters.size() != typeArguments.size()) { stubAlwaysWarn( String.format( - "annotateTypeParameters: mismatched sizes%n typeParameters (size %d)=%s%n typeArguments (size %d)=%s%n For more details, run with -AstubDebug%n", + "annotateTypeParameters: mismatched sizes: typeParameters (size %d)=%s; typeArguments (size %d)=%s; decl=%s; elt=%s (%s). For more details, run with -AstubDebug", typeParameters.size(), typeParameters, typeArguments.size(), - typeArguments)); + typeArguments, + decl.toString().replace(LINE_SEPARATOR, " "), + elt.toString().replace(LINE_SEPARATOR, " "), + elt.getClass())); } for (int i = 0; i < typeParameters.size(); ++i) { TypeParameter param = typeParameters.get(i); @@ -882,68 +933,63 @@ private void annotateTypeParameters( } } - private static final Set nestedClassWarnings = new HashSet(); - - private Map getMembers( - TypeElement typeElt, TypeDeclaration typeDecl) { - assert (typeElt.getSimpleName().contentEquals(typeDecl.getName()) - || typeDecl.getName().endsWith("$" + typeElt.getSimpleName().toString())) + private Map> getMembers( + TypeElement typeElt, TypeDeclaration typeDecl) { + assert (typeElt.getSimpleName().contentEquals(typeDecl.getNameAsString()) + || typeDecl.getNameAsString() + .endsWith("$" + typeElt.getSimpleName().toString())) : String.format("%s %s", typeElt.getSimpleName(), typeDecl.getName()); - Map result = new HashMap<>(); + Map> result = new HashMap<>(); + for (BodyDeclaration member : typeDecl.getMembers()) { + putNewElement(typeElt, result, member, typeDecl.getNameAsString()); + } + return result; + } - for (BodyDeclaration member : typeDecl.getMembers()) { - if (member instanceof MethodDeclaration) { - Element elt = findElement(typeElt, (MethodDeclaration) member); - if (elt != null) { - putNew(result, elt, member); - } - } else if (member instanceof ConstructorDeclaration) { - Element elt = findElement(typeElt, (ConstructorDeclaration) member); - if (elt != null) { - putNew(result, elt, member); - } - } else if (member instanceof FieldDeclaration) { - FieldDeclaration fieldDecl = (FieldDeclaration) member; - for (VariableDeclarator var : fieldDecl.getVariables()) { - Element varelt = findElement(typeElt, var); - if (varelt != null) { - putNew(result, varelt, fieldDecl); - } - } - } else if (member instanceof ClassOrInterfaceDeclaration) { - // TODO: handle nested classes - ClassOrInterfaceDeclaration ciDecl = (ClassOrInterfaceDeclaration) member; - String nestedClass = typeDecl.getName() + "." + ciDecl.getName(); - if (nestedClassWarnings.add(nestedClass)) { // avoid duplicate warnings - stubAlwaysWarn( - String.format( - "Warning: ignoring nested class in %s at line %d:%n class %s { class %s { ... } }%n", - filename, - ciDecl.getBeginLine(), - typeDecl.getName(), - ciDecl.getName()) - + "\n" - + String.format( - " Instead, write the nested class as a top-level class:%n class %s { ... }%n class %s$%s { ... }%n", - typeDecl.getName(), - typeDecl.getName(), - ciDecl.getName())); + private void putNewElement( + TypeElement typeElt, + Map> result, + BodyDeclaration member, + String typeDeclName) { + if (member instanceof MethodDeclaration) { + Element elt = findElement(typeElt, (MethodDeclaration) member); + if (elt != null) { + putNew(result, elt, member); + } + } else if (member instanceof ConstructorDeclaration) { + Element elt = findElement(typeElt, (ConstructorDeclaration) member); + if (elt != null) { + putNew(result, elt, member); + } + } else if (member instanceof FieldDeclaration) { + FieldDeclaration fieldDecl = (FieldDeclaration) member; + for (VariableDeclarator var : fieldDecl.getVariables()) { + Element varelt = findElement(typeElt, var); + if (varelt != null) { + putNew(result, varelt, fieldDecl); } - } else { - stubWarnIfNotFound( - String.format( - "Ignoring element of type %s in getMembers", member.getClass())); } + } else if (member instanceof ClassOrInterfaceDeclaration) { + Element elt = findElement(typeElt, (ClassOrInterfaceDeclaration) member); + if (elt != null) { + putNew(result, elt, member); + } + } else if (member instanceof EnumDeclaration) { + Element elt = findElement(typeElt, (EnumDeclaration) member); + if (elt != null) { + putNew(result, elt, member); + } + } else { + stubWarnIfNotFound( + String.format( + "Ignoring element of type %s in %s", member.getClass(), typeDeclName)); } - // // remove null keys, which can result from findElement returning null - // result.remove(null); - return result; } private AnnotatedDeclaredType findType( ClassOrInterfaceType type, List types) { - String typeString = type.getName(); + String typeString = type.getNameAsString(); for (AnnotatedDeclaredType superType : types) { if (superType .getUnderlyingType() @@ -956,21 +1002,91 @@ private AnnotatedDeclaredType findType( stubWarnIfNotFound("Type " + typeString + " not found"); if (debugStubParser) { for (AnnotatedDeclaredType superType : types) { - stubDebug(String.format(" %s%n", superType)); + stubDebug(String.format(" %s", superType)); + } + } + return null; + } + + /** + * Looks for the nested type element in the typeElt and returns it if the element has the same + * name as provided class or interface declaration. In case nested element is not found it + * returns null. + * + * @param typeElt an element where nested type element should be looked for + * @param ciDecl class or interface declaration which name should be found among nested elements + * of the typeElt + * @return nested in typeElt element with the name of the class or interface or null if nested + * element is not found + */ + private Element findElement(TypeElement typeElt, ClassOrInterfaceDeclaration ciDecl) { + final String wantedClassOrInterfaceName = ciDecl.getNameAsString(); + for (TypeElement typeElement : ElementUtils.getAllTypeElementsIn(typeElt)) { + if (wantedClassOrInterfaceName.equals(typeElement.getSimpleName().toString())) { + return typeElement; + } + } + + stubWarnIfNotFound( + "Class/interface " + wantedClassOrInterfaceName + " not found in type " + typeElt); + if (debugStubParser) { + for (ExecutableElement method : + ElementFilter.methodsIn(typeElt.getEnclosedElements())) { + stubDebug(String.format(" Here are the type declarations of %s:", typeElt)); + stubDebug(String.format(" %s", method)); } } return null; } + /** + * Looks for the nested enum element in the typeElt and returns it if the element has the same + * name as provided enum declaration. In case nested element is not found it returns null. + * + * @param typeElt an element where nested enum element should be looked for + * @param enumDecl enum declaration which name should be found among nested elements of the + * typeElt + * @return nested in typeElt enum element with the name of the provided enum or null if nested + * element is not found + */ + private Element findElement(TypeElement typeElt, EnumDeclaration enumDecl) { + final String wantedEnumName = enumDecl.getNameAsString(); + for (TypeElement typeElement : ElementUtils.getAllTypeElementsIn(typeElt)) { + if (wantedEnumName.equals(typeElement.getSimpleName().toString())) { + return typeElement; + } + } + + stubWarnIfNotFound("Enum " + wantedEnumName + " not found in type " + typeElt); + if (debugStubParser) { + for (ExecutableElement method : + ElementFilter.methodsIn(typeElt.getEnclosedElements())) { + stubDebug(String.format(" Here are the type declarations of %s:", typeElt)); + stubDebug(String.format(" %s", method)); + } + } + return null; + } + + /** + * Looks for method element in the typeElt and returns it if the element has the same signature + * as provided method declaration. In case method element is not found it returns null. + * + * @param typeElt type element where method element should be looked for + * @param methodDecl method declaration with signature that should be found among methods in the + * typeElt + * @return method element in typeElt with the same signature as the provided method declaration + * or null if method element is not found + */ private ExecutableElement findElement(TypeElement typeElt, MethodDeclaration methodDecl) { - final String wantedMethodName = methodDecl.getName(); + final String wantedMethodName = methodDecl.getNameAsString(); final int wantedMethodParams = (methodDecl.getParameters() == null) ? 0 : methodDecl.getParameters().size(); final String wantedMethodString = StubUtil.toString(methodDecl); for (ExecutableElement method : ElementUtils.getAllMethodsIn(elements, typeElt)) { // do heuristics first if (wantedMethodParams == method.getParameters().size() - && wantedMethodName.contentEquals(method.getSimpleName()) + && wantedMethodName.contentEquals(method.getSimpleName().toString()) && StubUtil.toString(method).equals(wantedMethodString)) { return method; } @@ -979,16 +1095,31 @@ private ExecutableElement findElement(TypeElement typeElt, MethodDeclaration met if (debugStubParser) { for (ExecutableElement method : ElementFilter.methodsIn(typeElt.getEnclosedElements())) { - stubDebug(String.format(" %s%n", method)); + stubDebug(String.format(" Here are the methods of %s:", typeElt)); + stubDebug(String.format(" %s", method)); } } return null; } - private ExecutableElement findElement(TypeElement typeElt, ConstructorDeclaration methodDecl) { + /** + * Looks for a constructor element in the typeElt and returns it if the element has the same + * signature as provided constructor declaration. In case constructor element is not found it + * returns null. + * + * @param typeElt type element where constructor element should be looked for + * @param constructorDecl constructor declaration with signature that should be found among + * constructors in the typeElt + * @return constructor element in typeElt with the same signature as the provided constructor + * declaration or null if constructor element is not found + */ + private ExecutableElement findElement( + TypeElement typeElt, ConstructorDeclaration constructorDecl) { final int wantedMethodParams = - (methodDecl.getParameters() == null) ? 0 : methodDecl.getParameters().size(); - final String wantedMethodString = StubUtil.toString(methodDecl); + (constructorDecl.getParameters() == null) + ? 0 + : constructorDecl.getParameters().size(); + final String wantedMethodString = StubUtil.toString(constructorDecl); for (ExecutableElement method : ElementFilter.constructorsIn(typeElt.getEnclosedElements())) { // do heuristics first @@ -1002,17 +1133,25 @@ private ExecutableElement findElement(TypeElement typeElt, ConstructorDeclaratio if (debugStubParser) { for (ExecutableElement method : ElementFilter.constructorsIn(typeElt.getEnclosedElements())) { - stubDebug(String.format(" %s%n", method)); + stubDebug(String.format(" %s", method)); } } return null; } private VariableElement findElement(TypeElement typeElt, VariableDeclarator variable) { - final String fieldName = variable.getId().getName(); + final String fieldName = variable.getNameAsString(); return findFieldElement(typeElt, fieldName); } + /** + * Looks for a field element in the typeElt and returns it if the element has the same name as + * provided. In case field element is not found it returns null. + * + * @param typeElt type element where field element should be looked for + * @param fieldName field name that should be found + * @return field element in typeElt with the provided name or null if field element is not found + */ private VariableElement findFieldElement(TypeElement typeElt, String fieldName) { for (VariableElement field : ElementUtils.getAllFieldsIn(elements, typeElt)) { // field.getSimpleName() is a CharSequence, not a String @@ -1024,7 +1163,7 @@ private VariableElement findFieldElement(TypeElement typeElt, String fieldName) stubWarnIfNotFound("Field " + fieldName + " not found in type " + typeElt); if (debugStubParser) { for (VariableElement field : ElementFilter.fieldsIn(typeElt.getEnclosedElements())) { - stubDebug(String.format(" %s%n", field)); + stubDebug(String.format(" %s", field)); } } return null; @@ -1060,20 +1199,9 @@ private static void putNew(Map m, K key, V value) { return; } if (m.containsKey(key) && !m.get(key).equals(value)) { - ErrorReporter.errorAbort( - "StubParser: key is already in map: " - + LINE_SEPARATOR - + " " - + key - + " => " - + m.get(key) - + LINE_SEPARATOR - + "while adding: " - + LINE_SEPARATOR - + " " - + key - + " => " - + value); + // Super method should not be written to the map + // if child class contains overriden method that is already in the map. + return; } m.put(key, value); } @@ -1120,9 +1248,11 @@ private static void putAllNew(Map m, Map m2) { private static Set warnings = new HashSet(); /** - * Issues the given warning about missing elements, only if it has not been previously issued. + * Issues the given warning about missing elements, only if it has not been previously issued + * and the -AstubWarnIfNotFound command-line argument was passed. */ private void stubWarnIfNotFound(String warning) { + ensureSingleLine(warning, "stubWarnIfNotFound"); if (warnings.add(warning) && (warnIfNotFound || debugStubParser)) { processingEnv .getMessager() @@ -1132,9 +1262,10 @@ private void stubWarnIfNotFound(String warning) { /** * Issues the given warning about overwriting bytecode, only if it has not been previously - * issued. + * issued and the -AstubWarnIfOverwritesBytecode command-line argument was passed. */ private void stubWarnIfOverwritesBytecode(String warning) { + ensureSingleLine(warning, "stubWarnIfOverwritesBytecode"); if (warnings.add(warning) && (warnIfStubOverwritesBytecode || debugStubParser)) { processingEnv .getMessager() @@ -1147,6 +1278,7 @@ private void stubWarnIfOverwritesBytecode(String warning) { * passed. */ private void stubAlwaysWarn(String warning) { + ensureSingleLine(warning, "stubAlwaysWarn"); if (warnings.add(warning)) { processingEnv .getMessager() @@ -1155,6 +1287,7 @@ private void stubAlwaysWarn(String warning) { } private void stubDebug(String warning) { + ensureSingleLine(warning, "stubDebug"); if (warnings.add(warning) && debugStubParser) { processingEnv .getMessager() @@ -1162,15 +1295,29 @@ private void stubDebug(String warning) { } } + /** + * Throw an error if the message contains line separator characters. (Any characters after a + * line separator are silently discarded and not shown to the user.) + */ + private void ensureSingleLine(String message, String methodName) { + if (message.contains(LINE_SEPARATOR)) { + throw new Error( + "Don't pass multi-line strings to " + + methodName + + ": " + + message.replace(LINE_SEPARATOR, "%n")); + } + } + private AnnotationMirror getAnnotation( AnnotationExpr annotation, Map supportedAnnotations) { AnnotationMirror annoMirror; if (annotation instanceof MarkerAnnotationExpr) { - String annoName = ((MarkerAnnotationExpr) annotation).getName().getName(); + String annoName = ((MarkerAnnotationExpr) annotation).getNameAsString(); annoMirror = supportedAnnotations.get(annoName); } else if (annotation instanceof NormalAnnotationExpr) { NormalAnnotationExpr nrmanno = (NormalAnnotationExpr) annotation; - String annoName = nrmanno.getName().getName(); + String annoName = nrmanno.getNameAsString(); annoMirror = supportedAnnotations.get(annoName); if (annoMirror == null) { // Not a supported qualifier -> ignore @@ -1180,7 +1327,7 @@ private AnnotationMirror getAnnotation( List pairs = nrmanno.getPairs(); if (pairs != null) { for (MemberValuePair mvp : pairs) { - String meth = mvp.getName(); + String meth = mvp.getNameAsString(); Expression exp = mvp.getValue(); handleExpr(builder, meth, exp); } @@ -1188,7 +1335,7 @@ private AnnotationMirror getAnnotation( return builder.build(); } else if (annotation instanceof SingleMemberAnnotationExpr) { SingleMemberAnnotationExpr sglanno = (SingleMemberAnnotationExpr) annotation; - String annoName = sglanno.getName().getName(); + String annoName = sglanno.getNameAsString(); annoMirror = supportedAnnotations.get(annoName); if (annoMirror == null) { // Not a supported qualifier -> ignore @@ -1416,7 +1563,7 @@ private void handleExpr(AnnotationBuilder builder, String name, Expression expr) } } - VariableElement res = findFieldElement(rcvElt, faexpr.getField()); + VariableElement res = findFieldElement(rcvElt, faexpr.getNameAsString()); faexprcache.put(faexpr, res); return res; } diff --git a/framework/src/org/checkerframework/framework/stub/StubUtil.java b/framework/src/org/checkerframework/framework/stub/StubUtil.java index 5457bb2a874..027cc8eb1de 100644 --- a/framework/src/org/checkerframework/framework/stub/StubUtil.java +++ b/framework/src/org/checkerframework/framework/stub/StubUtil.java @@ -1,5 +1,11 @@ package org.checkerframework.framework.stub; +import com.github.javaparser.ast.CompilationUnit; +import com.github.javaparser.ast.Node; +import com.github.javaparser.ast.StubUnit; +import com.github.javaparser.ast.body.*; +import com.github.javaparser.ast.type.*; +import com.github.javaparser.ast.visitor.SimpleVoidVisitor; import java.io.File; import java.io.IOException; import java.util.ArrayList; @@ -20,34 +26,18 @@ import javax.lang.model.type.TypeVariable; import org.checkerframework.javacutil.ErrorReporter; import org.checkerframework.javacutil.Pair; -import org.checkerframework.stubparser.ast.CompilationUnit; -import org.checkerframework.stubparser.ast.IndexUnit; -import org.checkerframework.stubparser.ast.Node; -import org.checkerframework.stubparser.ast.body.BodyDeclaration; -import org.checkerframework.stubparser.ast.body.ConstructorDeclaration; -import org.checkerframework.stubparser.ast.body.FieldDeclaration; -import org.checkerframework.stubparser.ast.body.MethodDeclaration; -import org.checkerframework.stubparser.ast.body.Parameter; -import org.checkerframework.stubparser.ast.body.TypeDeclaration; -import org.checkerframework.stubparser.ast.body.VariableDeclarator; -import org.checkerframework.stubparser.ast.type.ClassOrInterfaceType; -import org.checkerframework.stubparser.ast.type.PrimitiveType; -import org.checkerframework.stubparser.ast.type.ReferenceType; -import org.checkerframework.stubparser.ast.type.VoidType; -import org.checkerframework.stubparser.ast.type.WildcardType; -import org.checkerframework.stubparser.ast.visitor.SimpleVoidVisitor; /** Utility class for stub files */ public class StubUtil { - /*package-scope*/ static TypeDeclaration findDeclaration( - String className, IndexUnit indexFile) { + /*package-scope*/ static TypeDeclaration findDeclaration( + String className, StubUnit indexFile) { int indexOfDot = className.lastIndexOf('.'); if (indexOfDot == -1) { // classes not within a package needs to be the first in the index file assert !indexFile.getCompilationUnits().isEmpty(); - assert indexFile.getCompilationUnits().get(0).getPackage() == null; + assert indexFile.getCompilationUnits().get(0).getPackageDeclaration() == null; return findDeclaration(className, indexFile.getCompilationUnits().get(0)); } @@ -55,9 +45,9 @@ public class StubUtil { final String simpleName = className.substring(indexOfDot + 1); for (CompilationUnit cu : indexFile.getCompilationUnits()) { - if (cu.getPackage() != null - && cu.getPackage().getName().getName().equals(packageName)) { - TypeDeclaration type = findDeclaration(simpleName, cu); + if (cu.getPackageDeclaration().isPresent() + && cu.getPackageDeclaration().get().getNameAsString().equals(packageName)) { + TypeDeclaration type = findDeclaration(simpleName, cu); if (type != null) { return type; } @@ -68,20 +58,20 @@ public class StubUtil { return null; } - /*package-scope*/ static TypeDeclaration findDeclaration( - TypeElement type, IndexUnit indexFile) { + /*package-scope*/ static TypeDeclaration findDeclaration( + TypeElement type, StubUnit indexFile) { return findDeclaration(type.getQualifiedName().toString(), indexFile); } /*package-scope*/ static FieldDeclaration findDeclaration( - VariableElement field, IndexUnit indexFile) { - TypeDeclaration type = + VariableElement field, StubUnit indexFile) { + TypeDeclaration type = findDeclaration((TypeElement) field.getEnclosingElement(), indexFile); if (type == null) { return null; } - for (BodyDeclaration member : type.getMembers()) { + for (BodyDeclaration member : type.getMembers()) { if (!(member instanceof FieldDeclaration)) { continue; } @@ -95,9 +85,9 @@ public class StubUtil { return null; } - /*package-scope*/ static BodyDeclaration findDeclaration( - ExecutableElement method, IndexUnit indexFile) { - TypeDeclaration type = + /*package-scope*/ static BodyDeclaration findDeclaration( + ExecutableElement method, StubUnit indexFile) { + TypeDeclaration type = findDeclaration((TypeElement) method.getEnclosingElement(), indexFile); if (type == null) { return null; @@ -105,7 +95,7 @@ public class StubUtil { String methodRep = toString(method); - for (BodyDeclaration member : type.getMembers()) { + for (BodyDeclaration member : type.getMembers()) { if (member instanceof MethodDeclaration) { if (toString((MethodDeclaration) member).equals(methodRep)) { return member; @@ -119,10 +109,10 @@ public class StubUtil { return null; } - /*package-scope*/ static TypeDeclaration findDeclaration( + /*package-scope*/ static TypeDeclaration findDeclaration( String simpleName, CompilationUnit cu) { - for (TypeDeclaration type : cu.getTypes()) { - if (simpleName.equals(type.getName())) { + for (TypeDeclaration type : cu.getTypes()) { + if (simpleName.equals(type.getNameAsString())) { return type; } } @@ -139,7 +129,7 @@ public class StubUtil { } /*package-scope*/ static String toString(VariableDeclarator field) { - return field.getId().getName(); + return field.getNameAsString(); } /*package-scope*/ static String toString(FieldDeclaration field) { @@ -269,11 +259,6 @@ public void visit(MethodDeclaration n, Void arg) { @Override public void visit(Parameter n, Void arg) { - if (n.getId().getArrayCount() > 0) { - ErrorReporter.errorAbort( - "StubUtil: put array brackets on the type, not the variable: " + n); - } - n.getType().accept(this, arg); if (n.isVarArgs()) { sb.append("[]"); @@ -289,28 +274,28 @@ public void visit(ClassOrInterfaceType n, Void arg) { @Override public void visit(PrimitiveType n, Void arg) { switch (n.getType()) { - case Boolean: + case BOOLEAN: sb.append("boolean"); break; - case Byte: + case BYTE: sb.append("byte"); break; - case Char: + case CHAR: sb.append("char"); break; - case Double: + case DOUBLE: sb.append("double"); break; - case Float: + case FLOAT: sb.append("float"); break; - case Int: + case INT: sb.append("int"); break; - case Long: + case LONG: sb.append("long"); break; - case Short: + case SHORT: sb.append("short"); break; default: @@ -320,8 +305,16 @@ public void visit(PrimitiveType n, Void arg) { @Override public void visit(ReferenceType n, Void arg) { - n.getType().accept(this, arg); - for (int i = 0; i < n.getArrayCount(); ++i) { + n.getElementType().accept(this, arg); + for (int i = 0; i < n.getArrayLevel(); ++i) { + sb.append("[]"); + } + } + + @Override + public void visit(com.github.javaparser.ast.type.ArrayType n, Void arg) { + n.getComponentType().accept(this, arg); + for (int i = 0; i < n.getArrayLevel(); ++i) { sb.append("[]"); } } diff --git a/framework/src/org/checkerframework/framework/stub/ToIndexFileConverter.java b/framework/src/org/checkerframework/framework/stub/ToIndexFileConverter.java index a8576a3b305..528def68362 100644 --- a/framework/src/org/checkerframework/framework/stub/ToIndexFileConverter.java +++ b/framework/src/org/checkerframework/framework/stub/ToIndexFileConverter.java @@ -16,6 +16,29 @@ import annotations.field.AnnotationFieldType; import annotations.io.IndexFileParser; import annotations.io.IndexFileWriter; +import com.github.javaparser.JavaParser; +import com.github.javaparser.ParseException; +import com.github.javaparser.ParseProblemException; +import com.github.javaparser.ast.*; +import com.github.javaparser.ast.body.AnnotationDeclaration; +import com.github.javaparser.ast.body.BodyDeclaration; +import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; +import com.github.javaparser.ast.body.ConstructorDeclaration; +import com.github.javaparser.ast.body.EnumConstantDeclaration; +import com.github.javaparser.ast.body.EnumDeclaration; +import com.github.javaparser.ast.body.FieldDeclaration; +import com.github.javaparser.ast.body.InitializerDeclaration; +import com.github.javaparser.ast.body.MethodDeclaration; +import com.github.javaparser.ast.body.Parameter; +import com.github.javaparser.ast.body.TypeDeclaration; +import com.github.javaparser.ast.body.VariableDeclarator; +import com.github.javaparser.ast.expr.AnnotationExpr; +import com.github.javaparser.ast.expr.Expression; +import com.github.javaparser.ast.expr.ObjectCreationExpr; +import com.github.javaparser.ast.expr.VariableDeclarationExpr; +import com.github.javaparser.ast.stmt.BlockStmt; +import com.github.javaparser.ast.type.*; +import com.github.javaparser.ast.visitor.GenericVisitorAdapter; import com.sun.tools.javac.code.TypeAnnotationPosition.TypePathEntry; import java.io.BufferedWriter; import java.io.FileInputStream; @@ -31,37 +54,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import org.checkerframework.framework.util.PluginUtil; -import org.checkerframework.stubparser.JavaParser; -import org.checkerframework.stubparser.ParseException; -import org.checkerframework.stubparser.ast.CompilationUnit; -import org.checkerframework.stubparser.ast.ImportDeclaration; -import org.checkerframework.stubparser.ast.IndexUnit; -import org.checkerframework.stubparser.ast.PackageDeclaration; -import org.checkerframework.stubparser.ast.TypeParameter; -import org.checkerframework.stubparser.ast.body.AnnotationDeclaration; -import org.checkerframework.stubparser.ast.body.BodyDeclaration; -import org.checkerframework.stubparser.ast.body.ClassOrInterfaceDeclaration; -import org.checkerframework.stubparser.ast.body.ConstructorDeclaration; -import org.checkerframework.stubparser.ast.body.EnumConstantDeclaration; -import org.checkerframework.stubparser.ast.body.EnumDeclaration; -import org.checkerframework.stubparser.ast.body.FieldDeclaration; -import org.checkerframework.stubparser.ast.body.InitializerDeclaration; -import org.checkerframework.stubparser.ast.body.MethodDeclaration; -import org.checkerframework.stubparser.ast.body.Parameter; -import org.checkerframework.stubparser.ast.body.TypeDeclaration; -import org.checkerframework.stubparser.ast.body.VariableDeclarator; -import org.checkerframework.stubparser.ast.expr.AnnotationExpr; -import org.checkerframework.stubparser.ast.expr.Expression; -import org.checkerframework.stubparser.ast.expr.ObjectCreationExpr; -import org.checkerframework.stubparser.ast.expr.VariableDeclarationExpr; -import org.checkerframework.stubparser.ast.stmt.BlockStmt; -import org.checkerframework.stubparser.ast.type.ClassOrInterfaceType; -import org.checkerframework.stubparser.ast.type.PrimitiveType; -import org.checkerframework.stubparser.ast.type.ReferenceType; -import org.checkerframework.stubparser.ast.type.Type; -import org.checkerframework.stubparser.ast.type.VoidType; -import org.checkerframework.stubparser.ast.type.WildcardType; -import org.checkerframework.stubparser.ast.visitor.GenericVisitorAdapter; +import org.checkerframework.javacutil.ErrorReporter; /** * Convert a JAIF file plus a stub file into index files (JAIFs). Note that the resulting index @@ -98,7 +91,7 @@ public class ToIndexFileConverter extends GenericVisitorAdapter public ToIndexFileConverter( PackageDeclaration pkgDecl, List importDecls, AScene scene) { this.scene = scene; - pkgName = pkgDecl == null ? "" : pkgDecl.getName().getName(); + pkgName = pkgDecl == null ? "" : pkgDecl.getNameAsString(); if (importDecls == null) { imports = Collections.emptyList(); } else { @@ -170,7 +163,17 @@ public static void main(String[] args) { */ private static void convert(AScene scene, InputStream in, OutputStream out) throws IOException, DefException, ParseException { - IndexUnit iu = JavaParser.parse(in); + StubUnit iu; + try { + iu = JavaParser.parseStubUnit(in); + } catch (ParseProblemException e) { + iu = null; + ErrorReporter.errorAbort( + "ToIndexFileConverter: exception from JavaParser.parseStubUnit for InputStream." + + System.lineSeparator() + + "Problem message with problems encountered: " + + e.getMessage()); + } extractScene(iu, scene); try (Writer w = new BufferedWriter(new OutputStreamWriter(out))) { IndexFileWriter.write(scene, w); @@ -182,19 +185,19 @@ private static void convert(AScene scene, InputStream in, OutputStream out) * stub and scene in parallel, descending into them in the same way. It augments the existing * scene (it does not create a new scene). * - * @param iu {@link IndexUnit} representing stubfile + * @param iu {@link StubUnit} representing stubfile */ - private static void extractScene(IndexUnit iu, AScene scene) { + private static void extractScene(StubUnit iu, AScene scene) { for (CompilationUnit cu : iu.getCompilationUnits()) { - List typeDecls = cu.getTypes(); - if (typeDecls != null) { + NodeList> typeDecls = cu.getTypes(); + if (typeDecls != null && cu.getPackageDeclaration().isPresent()) { List impDecls = cu.getImports(); - PackageDeclaration pkgDecl = cu.getPackage(); - for (TypeDeclaration typeDecl : typeDecls) { + PackageDeclaration pkgDecl = cu.getPackageDeclaration().get(); + for (TypeDeclaration typeDecl : typeDecls) { ToIndexFileConverter converter = new ToIndexFileConverter(pkgDecl, impDecls, scene); String pkgName = converter.pkgName; - String name = typeDecl.getName(); + String name = typeDecl.getNameAsString(); if (!pkgName.isEmpty()) { name = pkgName + "." + name; } @@ -241,8 +244,8 @@ public Void visit(ClassOrInterfaceDeclaration decl, AElement elem) { @Override public Void visit(ConstructorDeclaration decl, AElement elem) { List params = decl.getParameters(); - List rcvrAnnos = decl.getReceiverAnnotations(); - BlockStmt body = decl.getBlock(); + List rcvrAnnos = decl.getAnnotations(); + BlockStmt body = decl.getBody(); StringBuilder sb = new StringBuilder("("); AClass clazz = (AClass) elem; AMethod method; @@ -277,7 +280,7 @@ public Void visit(ConstructorDeclaration decl, AElement elem) { @Override public Void visit(EnumConstantDeclaration decl, AElement elem) { - AField field = ((AClass) elem).fields.vivify(decl.getName()); + AField field = ((AClass) elem).fields.vivify(decl.getNameAsString()); visitDecl(decl, field); return super.visit(decl, field); } @@ -292,16 +295,16 @@ public Void visit(EnumDeclaration decl, AElement elem) { public Void visit(FieldDeclaration decl, AElement elem) { for (VariableDeclarator v : decl.getVariables()) { AClass clazz = (AClass) elem; - AField field = clazz.fields.vivify(v.getId().getName()); + AField field = clazz.fields.vivify(v.getNameAsString()); visitDecl(decl, field); - visitType(decl.getType(), field.type); + visitType(decl.getCommonType(), field.type); } return null; } @Override public Void visit(InitializerDeclaration decl, AElement elem) { - BlockStmt block = decl.getBlock(); + BlockStmt block = decl.getBody(); AClass clazz = (AClass) elem; block.accept(this, clazz.methods.vivify(decl.isStatic() ? "" : "")); return null; @@ -313,8 +316,8 @@ public Void visit(MethodDeclaration decl, AElement elem) { List params = decl.getParameters(); List typeParams = decl.getTypeParameters(); List rcvrAnnos = decl.getReceiverAnnotations(); - BlockStmt body = decl.getBody(); - StringBuilder sb = new StringBuilder(decl.getName()).append('('); + BlockStmt body = decl.getBody().orElse(null); + StringBuilder sb = new StringBuilder(decl.getNameAsString()).append('('); AClass clazz = (AClass) elem; AMethod method; if (params != null) { @@ -359,11 +362,11 @@ public Void visit(MethodDeclaration decl, AElement elem) { @Override public Void visit(ObjectCreationExpr expr, AElement elem) { ClassOrInterfaceType type = expr.getType(); - AClass clazz = scene.classes.vivify(type.getName()); - Expression scope = expr.getScope(); - List typeArgs = expr.getTypeArgs(); - List args = expr.getArgs(); - List decls = expr.getAnonymousClassBody(); + AClass clazz = scene.classes.vivify(type.getNameAsString()); + Expression scope = expr.getScope().orElse(null); + List typeArgs = expr.getTypeArguments().orElse(null); + List args = expr.getArguments(); + NodeList> bodyDecls = expr.getAnonymousClassBody().orElse(null); if (scope != null) { scope.accept(this, elem); } @@ -378,8 +381,8 @@ public Void visit(ObjectCreationExpr expr, AElement elem) { } } type.accept(this, clazz); - if (decls != null) { - for (BodyDeclaration decl : decls) { + if (bodyDecls != null) { + for (BodyDeclaration decl : bodyDecls) { decl.accept(this, clazz); } } @@ -390,12 +393,12 @@ public Void visit(ObjectCreationExpr expr, AElement elem) { public Void visit(VariableDeclarationExpr expr, AElement elem) { List annos = expr.getAnnotations(); AMethod method = (AMethod) elem; - List varDecls = expr.getVars(); + List varDecls = expr.getVariables(); for (int i = 0; i < varDecls.size(); i++) { VariableDeclarator decl = varDecls.get(i); - LocalLocation loc = new LocalLocation(decl.getId().getName(), i); + LocalLocation loc = new LocalLocation(decl.getNameAsString(), i); AField field = method.body.locals.vivify(loc); - visitType(expr.getType(), field.type); + visitType(expr.getCommonType(), field.type); if (annos != null) { for (AnnotationExpr annoExpr : annos) { Annotation anno = extractAnnotation(annoExpr); @@ -410,8 +413,8 @@ public Void visit(VariableDeclarationExpr expr, AElement elem) { * Copies information from an AST declaration node to an {@link ADeclaration}. Called by * visitors for BodyDeclaration subclasses. */ - private Void visitDecl(BodyDeclaration decl, ADeclaration elem) { - List annoExprs = decl.getAnnotations(); + private Void visitDecl(BodyDeclaration decl, ADeclaration elem) { + NodeList annoExprs = decl.getAnnotations(); if (annoExprs != null) { for (AnnotationExpr annoExpr : annoExprs) { Annotation anno = extractAnnotation(annoExpr); @@ -442,11 +445,13 @@ private static Void visitInnerTypes(Type type, final ATypeElement elem) { new GenericVisitorAdapter() { @Override public Void visit(ClassOrInterfaceType type, InnerTypeLocation loc) { - List typeArgs = type.getTypeArgs(); - for (int i = 0; i < typeArgs.size(); i++) { - Type inner = typeArgs.get(i); - InnerTypeLocation ext = extendedTypePath(loc, 3, i); - visitInnerType(inner, ext); + if (type.getTypeArguments().isPresent()) { + List typeArgs = type.getTypeArguments().get(); + for (int i = 0; i < typeArgs.size(); i++) { + Type inner = typeArgs.get(i); + InnerTypeLocation ext = extendedTypePath(loc, 3, i); + visitInnerType(inner, ext); + } } return null; } @@ -468,8 +473,8 @@ public Void visit(ReferenceType type, InnerTypeLocation loc) { @Override public Void visit(WildcardType type, InnerTypeLocation loc) { - ReferenceType lower = type.getExtends(); - ReferenceType upper = type.getSuper(); + ReferenceType lower = type.getExtendedType().orElse(null); + ReferenceType upper = type.getSuperType().orElse(null); if (lower != null) { InnerTypeLocation ext = extendedTypePath(loc, 2, 0); visitInnerType(lower, ext); @@ -496,7 +501,7 @@ private void visitInnerType(Type type, InnerTypeLocation loc) { /** * Extends type path by one element. * - * @see TypePathEntry.fromBinary + * @see TypePathEntry#fromBinary(int, int) */ private InnerTypeLocation extendedTypePath( InnerTypeLocation loc, int tag, int arg) { @@ -521,7 +526,7 @@ private String getJVML(Type type) { new GenericVisitorAdapter() { @Override public String visit(ClassOrInterfaceType type, Void v) { - String typeName = type.getName(); + String typeName = type.getNameAsString(); String name = resolve(typeName); if (name == null) { // could be defined in the same stub file @@ -533,21 +538,21 @@ public String visit(ClassOrInterfaceType type, Void v) { @Override public String visit(PrimitiveType type, Void v) { switch (type.getType()) { - case Boolean: + case BOOLEAN: return "Z"; - case Byte: + case BYTE: return "B"; - case Char: + case CHAR: return "C"; - case Double: + case DOUBLE: return "D"; - case Float: + case FLOAT: return "F"; - case Int: + case INT: return "I"; - case Long: + case LONG: return "J"; - case Short: + case SHORT: return "S"; default: throw new IllegalArgumentException( @@ -557,9 +562,9 @@ public String visit(PrimitiveType type, Void v) { @Override public String visit(ReferenceType type, Void v) { - String typeName = type.getType().accept(this, null); + String typeName = type.getElementType().accept(this, null); StringBuilder sb = new StringBuilder(); - int n = type.getArrayCount(); + int n = type.getArrayLevel(); for (int i = 0; i < n; i++) { sb.append("["); } @@ -574,7 +579,7 @@ public String visit(VoidType type, Void v) { @Override public String visit(WildcardType type, Void v) { - return type.getSuper().accept(this, null); + return type.getSuperType().get().accept(this, null); } }, null); @@ -624,8 +629,8 @@ private String resolve(String className) { /** * Combines an import with a name, yielding a fully-qualified name. * - * @param prefix name of imported package - * @param base name of class, possibly qualified + * @param importName package name; for an inner class, it should include the outer class + * @param className the class name * @return fully qualified class name if resolution succeeds, null otherwise */ private static String mergeImport(String importName, String className) { diff --git a/framework/src/org/checkerframework/framework/test/TypecheckResult.java b/framework/src/org/checkerframework/framework/test/TypecheckResult.java index c4836d63081..072f3556165 100644 --- a/framework/src/org/checkerframework/framework/test/TypecheckResult.java +++ b/framework/src/org/checkerframework/framework/test/TypecheckResult.java @@ -130,10 +130,9 @@ public String summarize() { } } - summaryBuilder.append( - "While type-checking " - + TestUtilities.summarizeSourceFiles( - configuration.getTestSourceFiles())); + summaryBuilder + .append("While type-checking ") + .append(TestUtilities.summarizeSourceFiles(configuration.getTestSourceFiles())); return summaryBuilder.toString(); } diff --git a/framework/tests/aliasing/stubfile.astub b/framework/tests/aliasing/stubfile.astub index b593bf43a37..cb5a0b93333 100644 --- a/framework/tests/aliasing/stubfile.astub +++ b/framework/tests/aliasing/stubfile.astub @@ -6,7 +6,7 @@ class String { class StringBuffer { @Unique StringBuffer(); - StringBuffer append(@NonLeaked String s) @LeakedToResult; + StringBuffer append(@LeakedToResult StringBuffer this, @NonLeaked String s); } class Exception { diff --git a/framework/tests/annotationclassloader/Makefile b/framework/tests/annotationclassloader/Makefile index c0618bceae1..ba0620237d0 100644 --- a/framework/tests/annotationclassloader/Makefile +++ b/framework/tests/annotationclassloader/Makefile @@ -14,6 +14,8 @@ PROJECTDIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) FRAMEWORKJAR := $(PROJECTDIR)/../../dist/framework.jar +STUBPARSERJAR := $(PROJECTDIR)/../../../framework/lib/javaparser-core.jar + # When called by the ant tests, JAVACJAR is defined as ${jsr308.langtools.dist}/lib/javac.jar # When executed as a demo, we'll use javac.jar located in a directory structure # which assumes that the jsr308-langtools project is located in the same @@ -23,7 +25,6 @@ JAVACJAR ?= $(PROJECTDIR)/../../../../jsr308-langtools/dist/lib/javac.jar # build directories DATAFLOWBUILD := $(PROJECTDIR)/../../../dataflow/build/ JAVACUTILBUILD := $(PROJECTDIR)/../../../javacutil/build/ -STUBPARSERBUILD := $(PROJECTDIR)/../../../stubparser/build/ FRAMEWORKBUILD := $(PROJECTDIR)/../../build/ all: load-from-dir-test load-from-jar-test @@ -34,7 +35,7 @@ all: load-from-dir-test load-from-jar-test demo1: @echo "***** This command is expected to produce an error on line 7:" $(JAVAC) \ - -J-Xbootclasspath/p:$(DATAFLOWBUILD):$(JAVACUTILBUILD):$(STUBPARSERBUILD):$(FRAMEWORKBUILD):$(JAVACJAR) \ + -J-Xbootclasspath/p:$(DATAFLOWBUILD):$(JAVACUTILBUILD):$(STUBPARSERJAR):$(FRAMEWORKBUILD):$(JAVACJAR) \ -classpath $(PROJECTDIR) \ -processor org.checkerframework.common.aliasing.AliasingChecker \ -Anomsgtext \ @@ -46,7 +47,7 @@ demo1: demo2: @echo "***** This command is expected to produce an error on line 7:" $(JAVAC) \ - -J-Xbootclasspath/p:$(FRAMEWORKJAR):$(JAVACJAR) \ + -J-Xbootclasspath/p:$(FRAMEWORKJAR):$(STUBPARSERJAR):$(JAVACJAR) \ -classpath :$(PROJECTDIR) \ -processor org.checkerframework.common.aliasing.AliasingChecker \ -Anomsgtext \ @@ -59,7 +60,7 @@ demo2: # loads from build directories load-from-dir-test: $(JAVAC) \ - -J-Xbootclasspath/p:$(DATAFLOWBUILD):$(JAVACUTILBUILD):$(STUBPARSERBUILD):$(FRAMEWORKBUILD):$(JAVACJAR) \ + -J-Xbootclasspath/p:$(DATAFLOWBUILD):$(JAVACUTILBUILD):$(STUBPARSERJAR):$(FRAMEWORKBUILD):$(JAVACJAR) \ -classpath $(PROJECTDIR) \ -processor org.checkerframework.common.aliasing.AliasingChecker \ -Anomsgtext \ @@ -72,7 +73,7 @@ load-from-dir-test: # loads from framework.jar load-from-jar-test: $(JAVAC) \ - -J-Xbootclasspath/p:$(FRAMEWORKJAR):$(JAVACJAR) \ + -J-Xbootclasspath/p:$(FRAMEWORKJAR):$(STUBPARSERJAR):$(JAVACJAR) \ -classpath $(PROJECTDIR) \ -processor org.checkerframework.common.aliasing.AliasingChecker \ -Anomsgtext \ diff --git a/framework/tests/reflection/reflection.astub b/framework/tests/reflection/reflection.astub index 940e65f4bb5..9d218b0ee44 100644 --- a/framework/tests/reflection/reflection.astub +++ b/framework/tests/reflection/reflection.astub @@ -4,10 +4,10 @@ package java.lang.reflect; class Method { - @Top Object invoke(@ReflectBottom Object obj, @ReflectBottom Object @ReflectBottom [] args) @Top; + @Top Object invoke(@Top Method this, @ReflectBottom Object obj, @ReflectBottom Object @ReflectBottom [] args); } class Constructor { - @Top Object newInstance(@ReflectBottom Object obj, @ReflectBottom Object @ReflectBottom [] args) @Top; + @Top Object newInstance(@Top Constructor this, @ReflectBottom Object obj, @ReflectBottom Object @ReflectBottom [] args); } diff --git a/javacutil/src/org/checkerframework/javacutil/ElementUtils.java b/javacutil/src/org/checkerframework/javacutil/ElementUtils.java index 4abfa86cb77..4bde2eb39ac 100644 --- a/javacutil/src/org/checkerframework/javacutil/ElementUtils.java +++ b/javacutil/src/org/checkerframework/javacutil/ElementUtils.java @@ -430,6 +430,13 @@ public static List getAllMethodsIn(Elements elements, TypeEle return Collections.unmodifiableList(meths); } + /** Return all nested/inner classes/interfaces declared in the given type. */ + public static List getAllTypeElementsIn(TypeElement type) { + List types = new ArrayList<>(); + types.addAll(ElementFilter.typesIn(type.getEnclosedElements())); + return types; + } + public static boolean isTypeDeclaration(Element elt) { switch (elt.getKind()) { // These tree kinds are always declarations. Uses of the declared diff --git a/stubparser/.classpath b/stubparser/.classpath deleted file mode 100644 index bdb2412f2ca..00000000000 --- a/stubparser/.classpath +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/stubparser/.project b/stubparser/.project deleted file mode 100644 index 81a63768367..00000000000 --- a/stubparser/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - stubparser - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - diff --git a/stubparser/LICENSE b/stubparser/LICENSE deleted file mode 100644 index 012ddda7574..00000000000 --- a/stubparser/LICENSE +++ /dev/null @@ -1,6 +0,0 @@ -JavaParser is available either under the terms of the LGPL License or the Apache License. You as the user are entitled to choose the terms under which to adopt JavaParser. - -For details about the LGPL License please refer to LICENSE.LGPL. Please note -that LGPL is just an extension to GPL, located in LICENSE.GPL. - -For details about the Apache License please refer to LICENSE.APACHE diff --git a/stubparser/LICENSE.APACHE b/stubparser/LICENSE.APACHE deleted file mode 100644 index d6456956733..00000000000 --- a/stubparser/LICENSE.APACHE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/stubparser/LICENSE.GPL b/stubparser/LICENSE.GPL deleted file mode 100644 index fb1a1b0ba7e..00000000000 --- a/stubparser/LICENSE.GPL +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - Java 1.5 japa.parser and Abstract Syntax Tree - Copyright (C) 2007 J�lio Vilmar Gesser - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Java 1.5 japa.parser and Abstract Syntax Tree Copyright (C) 2007 J�lio Vilmar Gesser - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/stubparser/LICENSE.LGPL b/stubparser/LICENSE.LGPL deleted file mode 100644 index b87303c39a7..00000000000 --- a/stubparser/LICENSE.LGPL +++ /dev/null @@ -1,165 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/stubparser/README b/stubparser/README deleted file mode 100644 index 684a5c1e5d1..00000000000 --- a/stubparser/README +++ /dev/null @@ -1,25 +0,0 @@ -stubparser -__________ - -A JSR-308-conforming Java parser with AST generation and visitor support. -The project is based on javaparser (http://javaparser.github.io/javaparser/). - -The project branched off of javaparser 1.0.7, available at: - http://code.google.com/p/javaparser/downloads/list - -Known Issues: -- does not parse annotations on new class or new array expressions -- uses the old receiver parameter syntax, must be adapted -- This is only a Java 1.5 parser, ideally we would update to a more recent - version that supports Java 8. This is low priority because users are - encouraged to use annotated libraries rather than stub files. - -------------------------------------------------------------------------- -To modify and rebuild the parser, install javacc (the Java Compiler -Compiler, available from http://javacc.java.net/), edit the grammar -in src/japa/parser/java_1_5.jj, and rebuild the parser: - cd src/java/parser - javacc java_1_5.jj - -When debugging parser changes, the -debug_parser option is helpful. It -provides extensive debug output about what parses are attempted. diff --git a/stubparser/build.properties b/stubparser/build.properties deleted file mode 100644 index cc16487468e..00000000000 --- a/stubparser/build.properties +++ /dev/null @@ -1,2 +0,0 @@ -## This is a configuration file for use by Ant when building the -## Checker Framework. diff --git a/stubparser/build.xml b/stubparser/build.xml deleted file mode 100644 index 6d1cd64a520..00000000000 --- a/stubparser/build.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - Builds the Java parser for Checker Framework stub files. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stubparser/readme.txt b/stubparser/readme.txt deleted file mode 100644 index b6b17833b2f..00000000000 --- a/stubparser/readme.txt +++ /dev/null @@ -1,150 +0,0 @@ -+-------------------------------------------------------------------------------+ -| Java 1.5 parser and Abstract Syntax Tree. | -+-------------------------------------------------------------------------------+ -| Copyright (C) 2007 Júlio Vilmar Gesser | -| jgesser@gmail.com | -| http://code.google.com/p/javaparser/ | -+-------------------------------------------------------------------------------+ -| This program is free software: you can redistribute it and/or modify | -| it under the terms of the GNU Lesser General Public License as published by | -| the Free Software Foundation, either version 3 of the License, or | -| (at your option) any later version. | -| | -| This program is distributed in the hope that it will be useful, | -| but WITHOUT ANY WARRANTY; without even the implied warranty of | -| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | -| GNU Lesser General Public License for more details. | -| | -| You should have received a copy of the GNU Lesser General Public License | -| along with this program. If not, see . | -+-------------------------------------------------------------------------------+ - -This package contains a Java 1.5 Parser with AST generation and visitor support. -The AST records the source code structure, javadoc and comments. Soon will be -possible change the AST nodes or create new ones to modify source code like refactoring. -This parser is based on Sreenivasa Viswanadha Java 1.5 parser. - -Visit the project site, there you can get help, view some sample codes, report -bugs and feature enhacement and download the latest version: - http://code.google.com/p/javaparser/ - - -Version history ---------------- - -1.0.8 (2010-01-17) -- Fixed issues: - - Issue 17: A refactor suggestion for AnnotationExpr and its subclasses - - Issue 21: Java 5 JavaParser compiled JARs - - Issue 22: Please use java.lang.reflect.Modifier constants in cfjapa.parser.ast.body.ModifierSet - - Issue 27: Implement the "equal" method - - Issue 30: equals and hashCode methods - -1.0.7 (2009-04-12) -- Issue 19 fixed: -- Tests changed to run with junit 4 - -1.0.6 (2009-01-11) -- Issue 11 fixed: changed method get/setPakage to get/setPackage in the class CompilationUnit -- Created new visitor adapter to help AST modification: ModifierVisitorAdapter -- Changed visitor adapters to abstract - -1.0.5 (2008-10-26) -- Created simplified constructors in the nodes of the AST (without positional arguments) -- Created ASTHelper class with some helpful methods (more methods are still needed) - -1.0.4 (2008-10-07) -- Moved to javacc 4.1. -- The java_1_5.jj can be build alone without compilation errors - -1.0.3 (2008-09-06) -- Removed SuperMemberAccessExpr class, it was no longer used -- Removed the methods get/setTypeArgs() from ArrayCreationExpr, this node shouldn't have these methods. -- Fixed the bug with start/end position of the nodes IntegerLiteralMinValueExpr and LongLiteralMinValueExpr -- The methods get/setAnnotations() from all BodyDeclaration subclasses were pushed down to BodyDeclaration class - -1.0.2 (2008-07-20) - Issue fixed: Issue 1: Add support for editing AST nodes or create new ones - -1.0.1 (2008-07-01) -- Issue fixed: Issue 5: end line and end column equal to begin line and begin column - -1.0.0 (2008-06-25) -- Changed version numbering, starting version 1.0.0 -- Javadoc done for packages: - - cfjapa.parser - - cfjapa.parser.ast -- Corrected bug when parsing in multithread: - - JavaParser.setCacheParser(false) must be called before to use the parser concurrent - -2008-06-19 -- No code changes, added binary distribution to download page - -2008-06-11 -- Bug corrected: NPE in VoidVisitorAdapter - - http://code.google.com/p/javaparser/issues/detail?id=2 - -2008-06-09 -- Added Adapters for de visitors - -2008-05-28 -- This project now is published at Google Code: - - http://code.google.com/p/javaparser/ - -2008-05-25 -- Added support for comments and javadoc to the tree. - - Javadocs are stored directly to members (BodyDeclaration and all deriveds (classes, methods, fields, etc.)), accessible by the method getJavadoc(). - - All comments are stored in the CompilationUnit, accessible by the method getComments(). - -2008-04-01 -- Changed all nodes public attributes to be private and created getters to access them -- Changed the methods of the Node getLine e getColumn to getBeginLine and getBeginColumn -- Added the methods getEndLine and getEndColumn to the Node class (works only in the BlockNode) - -2007-12-22 -- Corrected ConditionalExpression bug - -2007-10-21 -- Added LGPL License - -2007-10-21 -- Bugs corrected: - - Created PackageDeclaration member of CompilationUnit to add suport for annotations in the package declaration - - Parameterized anonymous constructor invocation - - Explicit constructor invotation Type Arguments - - ctrl+z ("\u001A") ar end of compilation unit - -2007-10-09 -- EnumConstantDeclaration annotation support corrected -- Parssing Java Unicode escape characters suport added - -2007-10-03 -- Bug corrected: "MotifComboPopup.this.super()" statement was generating parser error - -2007-10-01 -- Bug corrected: Casting signed primitive values - double d = (double) -1; - ^ - -2007-08-06 -- Bug with the ingle line comments in the final of the unit corrected - -2007-07-31 -- Fixed the bug with the following expression: - Class c = (int.class); - -2007-06-26 -- Bug fixes from Leon Poyyayil work - - suport for hex floating point - - unicode digits in indentifier - - MemberValueArrayInitializer - -2007-03-09 -- Long and Integer literal MIN_VALUE bug - -2007-02-24 -- '\0' bug fixed - -2007-02-01 -- Many bug fixes -- Added line/column to nodes diff --git a/stubparser/src/org/checkerframework/stubparser/ASTHelper.java b/stubparser/src/org/checkerframework/stubparser/ASTHelper.java deleted file mode 100644 index 39c27862169..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ASTHelper.java +++ /dev/null @@ -1,258 +0,0 @@ -package org.checkerframework.stubparser; - -import java.util.ArrayList; -import java.util.List; - -import org.checkerframework.stubparser.ast.CompilationUnit; -import org.checkerframework.stubparser.ast.body.BodyDeclaration; -import org.checkerframework.stubparser.ast.body.FieldDeclaration; -import org.checkerframework.stubparser.ast.body.MethodDeclaration; -import org.checkerframework.stubparser.ast.body.Parameter; -import org.checkerframework.stubparser.ast.body.TypeDeclaration; -import org.checkerframework.stubparser.ast.body.VariableDeclarator; -import org.checkerframework.stubparser.ast.body.VariableDeclaratorId; -import org.checkerframework.stubparser.ast.expr.Expression; -import org.checkerframework.stubparser.ast.expr.MethodCallExpr; -import org.checkerframework.stubparser.ast.expr.NameExpr; -import org.checkerframework.stubparser.ast.expr.QualifiedNameExpr; -import org.checkerframework.stubparser.ast.expr.VariableDeclarationExpr; -import org.checkerframework.stubparser.ast.stmt.BlockStmt; -import org.checkerframework.stubparser.ast.stmt.ExpressionStmt; -import org.checkerframework.stubparser.ast.stmt.Statement; -import org.checkerframework.stubparser.ast.type.ClassOrInterfaceType; -import org.checkerframework.stubparser.ast.type.PrimitiveType; -import org.checkerframework.stubparser.ast.type.ReferenceType; -import org.checkerframework.stubparser.ast.type.Type; -import org.checkerframework.stubparser.ast.type.VoidType; -import org.checkerframework.stubparser.ast.type.PrimitiveType.Primitive; - -/** - * This class helps to construct new nodes. - * - * @author Julio Vilmar Gesser - */ -public final class ASTHelper { - - public static final PrimitiveType BYTE_TYPE = new PrimitiveType(Primitive.Byte); - - public static final PrimitiveType SHORT_TYPE = new PrimitiveType(Primitive.Short); - - public static final PrimitiveType INT_TYPE = new PrimitiveType(Primitive.Int); - - public static final PrimitiveType LONG_TYPE = new PrimitiveType(Primitive.Long); - - public static final PrimitiveType FLOAT_TYPE = new PrimitiveType(Primitive.Float); - - public static final PrimitiveType DOUBLE_TYPE = new PrimitiveType(Primitive.Double); - - public static final PrimitiveType BOOLEAN_TYPE = new PrimitiveType(Primitive.Boolean); - - public static final PrimitiveType CHAR_TYPE = new PrimitiveType(Primitive.Char); - - public static final VoidType VOID_TYPE = new VoidType(); - - private ASTHelper() { - // nop - } - - /** - * Creates a new {@link NameExpr} from a qualified name.
- * The qualified name can contains "." (dot) characters. - * - * @param qualifiedName - * qualified name - * @return instanceof {@link NameExpr} - */ - public static NameExpr createNameExpr(String qualifiedName) { - String[] split = qualifiedName.split("\\."); - NameExpr ret = new NameExpr(split[0]); - for (int i = 1; i < split.length; i++) { - ret = new QualifiedNameExpr(ret, split[i]); - } - return ret; - } - - /** - * Creates a new {@link Parameter}. - * - * @param type - * type of the parameter - * @param name - * name of the parameter - * @return instance of {@link Parameter} - */ - public static Parameter createParameter(Type type, String name) { - return new Parameter(type, new VariableDeclaratorId(name)); - } - - /** - * Creates a {@link FieldDeclaration}. - * - * @param modifiers - * modifiers - * @param type - * type - * @param variable - * variable declarator - * @return instance of {@link FieldDeclaration} - */ - public static FieldDeclaration createFieldDeclaration(int modifiers, Type type, VariableDeclarator variable) { - List variables = new ArrayList(); - variables.add(variable); - FieldDeclaration ret = new FieldDeclaration(modifiers, type, variables); - return ret; - } - - /** - * Creates a {@link FieldDeclaration}. - * - * @param modifiers - * modifiers - * @param type - * type - * @param name - * field name - * @return instance of {@link FieldDeclaration} - */ - public static FieldDeclaration createFieldDeclaration(int modifiers, Type type, String name) { - VariableDeclaratorId id = new VariableDeclaratorId(name); - VariableDeclarator variable = new VariableDeclarator(id); - return createFieldDeclaration(modifiers, type, variable); - } - - /** - * Creates a {@link VariableDeclarationExpr}. - * - * @param type - * type - * @param name - * name - * @return instance of {@link VariableDeclarationExpr} - */ - public static VariableDeclarationExpr createVariableDeclarationExpr(Type type, String name) { - List vars = new ArrayList(); - vars.add(new VariableDeclarator(new VariableDeclaratorId(name))); - return new VariableDeclarationExpr(type, vars); - } - - /** - * Adds the given parameter to the method. The list of parameters will be - * initialized if it is {@code null}. - * - * @param method - * method - * @param parameter - * parameter - */ - public static void addParameter(MethodDeclaration method, Parameter parameter) { - List parameters = method.getParameters(); - if (parameters == null) { - parameters = new ArrayList(); - method.setParameters(parameters); - } - parameters.add(parameter); - } - - /** - * Adds the given argument to the method call. The list of arguments will be - * initialized if it is {@code null}. - * - * @param call - * method call - * @param arg - * argument value - */ - public static void addArgument(MethodCallExpr call, Expression arg) { - List args = call.getArgs(); - if (args == null) { - args = new ArrayList(); - call.setArgs(args); - } - args.add(arg); - } - - /** - * Adds the given type declaration to the compilation unit. The list of - * types will be initialized if it is {@code null}. - * - * @param cu - * compilation unit - * @param type - * type declaration - */ - public static void addTypeDeclaration(CompilationUnit cu, TypeDeclaration type) { - List types = cu.getTypes(); - if (types == null) { - types = new ArrayList(); - cu.setTypes(types); - } - types.add(type); - - } - - /** - * Creates a new {@link ReferenceType} for a class or interface. - * - * @param name - * name of the class or interface - * @param arrayCount - * number os arrays or {@code 0} if is not a array. - * @return instanceof {@link ReferenceType} - */ - public static ReferenceType createReferenceType(String name, int arrayCount) { - return new ReferenceType(new ClassOrInterfaceType(name), arrayCount); - } - - /** - * Creates a new {@link ReferenceType} for the given primitive type. - * - * @param type - * primitive type - * @param arrayCount - * number os arrays or {@code 0} if is not a array. - * @return instanceof {@link ReferenceType} - */ - public static ReferenceType createReferenceType(PrimitiveType type, int arrayCount) { - return new ReferenceType(type, arrayCount); - } - - /** - * Adds the given statement to the specified block. The list of statements - * will be initialized if it is {@code null}. - */ - public static void addStmt(BlockStmt block, Statement stmt) { - List stmts = block.getStmts(); - if (stmts == null) { - stmts = new ArrayList(); - block.setStmts(stmts); - } - stmts.add(stmt); - } - - /** - * Adds the given expression to the specified block. The list of statements - * will be initialized if it is {@code null}. - */ - public static void addStmt(BlockStmt block, Expression expr) { - addStmt(block, new ExpressionStmt(expr)); - } - - /** - * Adds the given declaration to the specified type. The list of members - * will be initialized if it is {@code null}. - * - * @param type - * type declaration - * @param decl - * member declaration - */ - public static void addMember(TypeDeclaration type, BodyDeclaration decl) { - List members = type.getMembers(); - if (members == null) { - members = new ArrayList(); - type.setMembers(members); - } - members.add(decl); - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ASTParser.java b/stubparser/src/org/checkerframework/stubparser/ASTParser.java deleted file mode 100644 index febb4e7d1d1..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ASTParser.java +++ /dev/null @@ -1,8536 +0,0 @@ -/* Generated By:JavaCC: Do not edit this line. ASTParser.java */ -/* - * Copyright (C) 2008 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -package org.checkerframework.stubparser; - -import java.io.*; -import java.util.*; - -import org.checkerframework.stubparser.ast.*; -import org.checkerframework.stubparser.ast.body.*; -import org.checkerframework.stubparser.ast.expr.*; -import org.checkerframework.stubparser.ast.stmt.*; -import org.checkerframework.stubparser.ast.type.*; - -/** - *

This class was generated automatically by javacc, do not edit.

- * @author Júlio Vilmar Gesser - */ -final class ASTParser implements ASTParserConstants { - - void reset(InputStream in, String encoding) { - ReInit(in, encoding); - token_source.clearComments(); - } - - private List add(List list, Object obj) { - if (list == null) { - list = new LinkedList(); - } - list.add(obj); - return list; - } - - private List add(int pos, List list, Object obj) { - if (list == null) { - list = new LinkedList(); - } - list.add(pos, obj); - return list; - } - - private static class Modifier { - - final int modifiers; - final List annotations; - final int beginLine; - final int beginColumn; - - public Modifier(int beginLine, int beginColumn, int modifiers, List annotations) { - this.beginLine = beginLine; - this.beginColumn = beginColumn; - this.modifiers = modifiers; - this.annotations = annotations; - } - } - - public int addModifier(int modifiers, int mod, Token token) throws ParseException { - if ((ModifierSet.hasModifier(modifiers, mod))) { - throwParseException(token, "Duplicated modifier"); - } - return ModifierSet.addModifier(modifiers, mod); - } - - private void pushJavadoc() { - token_source.pushJavadoc(); - } - - private JavadocComment popJavadoc() { - return token_source.popJavadoc(); - } - - private List getComments() { - return token_source.getComments(); - } - - private void throwParseException(Token token, String message) throws ParseException { - StringBuilder buf = new StringBuilder(); - buf.append(message); - buf.append(": \u005c""); - buf.append(token.image); - buf.append("\u005c" at line "); - buf.append(token.beginLine); - buf.append(", column "); - buf.append(token.beginColumn); - ParseException e = new ParseException(buf.toString()); - e.currentToken = token; - throw e; - } - - static final class GTToken extends Token { - - int realKind = ASTParserConstants.GT; - - GTToken(int kind, String image) { - this.kind = kind; - this.image = image; - } - - public static Token newToken(int kind, String image) { - return new GTToken(kind, image); - } - } - -/***************************************** - * THE JAVA LANGUAGE GRAMMAR STARTS HERE * - *****************************************/ - final public IndexUnit IndexUnit() throws ParseException { - /* Actual Type */ - List compilationUnits = new LinkedList(); - CompilationUnit cu; - - /* Parsing the compilation unit itself */ - PackageDeclaration pakage = null; - List imports = null; - ImportDeclaration in = null; - List types = null; - TypeDeclaration tn = null; - int line = -1; - int column = 0; - if (jj_2_1(2147483647)) { - pakage = PackageDeclaration(); - line = pakage.getBeginLine(); column = pakage.getBeginColumn(); - } else { - ; - } - label_1: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IMPORT: - ; - break; - default: - jj_la1[0] = jj_gen; - break label_1; - } - in = ImportDeclaration(); - if (line==-1){line = in.getBeginLine(); column = in.getBeginColumn();} imports = add(imports, in); - } - label_2: - while (true) { - if (jj_2_2(2147483647)) { - ; - } else { - break label_2; - } - tn = TypeDeclaration(); - if (line==-1){line = tn.getBeginLine(); column = tn.getBeginColumn();} types = add(types, tn); - } - cu = new CompilationUnit(line == -1 ? 0 : line, column, token.endLine, token.endColumn,pakage, imports, types, getComments()); - compilationUnits.add(cu); - label_3: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case PACKAGE: - case AT: - ; - break; - default: - jj_la1[1] = jj_gen; - break label_3; - } - pakage = PackageDeclaration(); - line = pakage.getBeginLine(); column = pakage.getBeginColumn(); imports = new LinkedList(); types = new LinkedList(); - label_4: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IMPORT: - ; - break; - default: - jj_la1[2] = jj_gen; - break label_4; - } - in = ImportDeclaration(); - if (line==-1){line = in.getBeginLine(); column = in.getBeginColumn();} imports = add(imports, in); - } - label_5: - while (true) { - if (jj_2_3(2147483647)) { - ; - } else { - break label_5; - } - tn = TypeDeclaration(); - if (line==-1){line = tn.getBeginLine(); column = tn.getBeginColumn();} types = add(types, tn); - } - cu = new CompilationUnit(line == -1 ? 0 : line, column, token.endLine, token.endColumn,pakage, imports, types, getComments()); - compilationUnits.add(cu); - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case 0: - jj_consume_token(0); - break; - case 128: - jj_consume_token(128); - break; - default: - jj_la1[3] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - {if (true) return new IndexUnit(compilationUnits);} - throw new Error("Missing return statement in function"); - } - -/* - * Program structuring syntax follows. - */ - final public CompilationUnit CompilationUnit() throws ParseException { - PackageDeclaration pakage = null; - List imports = null; - ImportDeclaration in = null; - List types = null; - TypeDeclaration tn = null; - int line = -1; - int column = 0; - if (jj_2_4(2147483647)) { - pakage = PackageDeclaration(); - line = pakage.getBeginLine(); column = pakage.getBeginColumn(); - } else { - ; - } - label_6: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IMPORT: - ; - break; - default: - jj_la1[4] = jj_gen; - break label_6; - } - in = ImportDeclaration(); - if (line==-1){line = in.getBeginLine(); column = in.getBeginColumn();} imports = add(imports, in); - } - label_7: - while (true) { - if (jj_2_5(2147483647)) { - ; - } else { - break label_7; - } - tn = TypeDeclaration(); - if (line==-1){line = tn.getBeginLine(); column = tn.getBeginColumn();} types = add(types, tn); - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case 0: - jj_consume_token(0); - break; - case 128: - jj_consume_token(128); - break; - default: - jj_la1[5] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - {if (true) return new CompilationUnit(line == -1 ? 0 : line, column, token.endLine, token.endColumn,pakage, imports, types, getComments());} - throw new Error("Missing return statement in function"); - } - - final public PackageDeclaration PackageDeclaration() throws ParseException { - List annotations = null; - AnnotationExpr ann; - NameExpr name; - int line; - int column; - label_8: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case AT: - ; - break; - default: - jj_la1[6] = jj_gen; - break label_8; - } - ann = Annotation(); - annotations = add(annotations, ann); - } - jj_consume_token(PACKAGE); - line=token.beginLine; column=token.beginColumn; - name = Name(); - jj_consume_token(SEMICOLON); - {if (true) return new PackageDeclaration(line, column, token.endLine, token.endColumn,annotations, name);} - throw new Error("Missing return statement in function"); - } - - final public ImportDeclaration ImportDeclaration() throws ParseException { - NameExpr name; - boolean isStatic = false; - boolean isAsterisk = false; - int line; - int column; - jj_consume_token(IMPORT); - line=token.beginLine; column=token.beginColumn; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case STATIC: - jj_consume_token(STATIC); - isStatic = true; - break; - default: - jj_la1[7] = jj_gen; - ; - } - name = Name(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case DOT: - jj_consume_token(DOT); - jj_consume_token(STAR); - isAsterisk = true; - break; - default: - jj_la1[8] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - {if (true) return new ImportDeclaration(line, column, token.endLine, token.endColumn,name, isStatic, isAsterisk);} - throw new Error("Missing return statement in function"); - } - -/* - * Modifiers. We match all modifiers in a single rule to reduce the chances of - * syntax errors for simple modifier mistakes. It will also enable us to give - * better error messages. - */ - final public Modifier Modifiers() throws ParseException { - int beginLine = -1; - int beginColumn = -1; - int modifiers = 0; - List annotations = null; - AnnotationExpr ann; - label_9: - while (true) { - if (jj_2_6(2)) { - ; - } else { - break label_9; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case PUBLIC: - jj_consume_token(PUBLIC); - modifiers = addModifier(modifiers, ModifierSet.PUBLIC, token); if (beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} - break; - case STATIC: - jj_consume_token(STATIC); - modifiers = addModifier(modifiers, ModifierSet.STATIC, token); if (beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} - break; - case PROTECTED: - jj_consume_token(PROTECTED); - modifiers = addModifier(modifiers, ModifierSet.PROTECTED, token); if (beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} - break; - case PRIVATE: - jj_consume_token(PRIVATE); - modifiers = addModifier(modifiers, ModifierSet.PRIVATE, token); if (beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} - break; - case FINAL: - jj_consume_token(FINAL); - modifiers = addModifier(modifiers, ModifierSet.FINAL, token); if (beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} - break; - case ABSTRACT: - jj_consume_token(ABSTRACT); - modifiers = addModifier(modifiers, ModifierSet.ABSTRACT, token); if (beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} - break; - case SYNCHRONIZED: - jj_consume_token(SYNCHRONIZED); - modifiers = addModifier(modifiers, ModifierSet.SYNCHRONIZED, token); if (beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} - break; - case NATIVE: - jj_consume_token(NATIVE); - modifiers = addModifier(modifiers, ModifierSet.NATIVE, token); if (beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} - break; - case TRANSIENT: - jj_consume_token(TRANSIENT); - modifiers = addModifier(modifiers, ModifierSet.TRANSIENT, token); if (beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} - break; - case VOLATILE: - jj_consume_token(VOLATILE); - modifiers = addModifier(modifiers, ModifierSet.VOLATILE, token); if (beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} - break; - case STRICTFP: - jj_consume_token(STRICTFP); - modifiers = addModifier(modifiers, ModifierSet.STRICTFP, token); if (beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} - break; - case AT: - ann = Annotation(); - annotations = add(annotations, ann); if (beginLine==-1) {beginLine=ann.getBeginLine(); beginColumn=ann.getBeginColumn();} - break; - default: - jj_la1[9] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - {if (true) return new Modifier(beginLine, beginColumn, modifiers, annotations);} - throw new Error("Missing return statement in function"); - } - -/* - * Declaration syntax follows. - */ - final public TypeDeclaration TypeDeclaration() throws ParseException { - Modifier modifier; - TypeDeclaration ret; - pushJavadoc(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case SEMICOLON: - jj_consume_token(SEMICOLON); - ret = new EmptyTypeDeclaration(token.beginLine, token.beginColumn, token.endLine, token.endColumn, popJavadoc()); - break; - case ABSTRACT: - case CLASS: - case ENUM: - case FINAL: - case INTERFACE: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOLATILE: - case AT: - modifier = Modifiers(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case CLASS: - case INTERFACE: - ret = ClassOrInterfaceDeclaration(modifier); - break; - case ENUM: - ret = EnumDeclaration(modifier); - break; - case AT: - ret = AnnotationTypeDeclaration(modifier); - break; - default: - jj_la1[10] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - default: - jj_la1[11] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public ClassOrInterfaceDeclaration ClassOrInterfaceDeclaration(Modifier modifier) throws ParseException { - boolean isInterface = false; - String name; - List typePar = null; - List extList = null; - List impList = null; - List members; - int line = modifier.beginLine; - int column = modifier.beginColumn; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case CLASS: - jj_consume_token(CLASS); - break; - case INTERFACE: - jj_consume_token(INTERFACE); - isInterface = true; - break; - default: - jj_la1[12] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - if (line == -1) {line=token.beginLine; column=token.beginColumn;} - jj_consume_token(IDENTIFIER); - name = token.image; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LT: - typePar = TypeParameters(); - typePar.remove(0); - break; - default: - jj_la1[13] = jj_gen; - ; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case EXTENDS: - extList = ExtendsList(isInterface); - break; - default: - jj_la1[14] = jj_gen; - ; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IMPLEMENTS: - impList = ImplementsList(isInterface); - break; - default: - jj_la1[15] = jj_gen; - ; - } - members = ClassOrInterfaceBody(isInterface); - {if (true) return new ClassOrInterfaceDeclaration(line, column, token.endLine, token.endColumn,popJavadoc(), modifier.modifiers, modifier.annotations, isInterface, name, typePar, extList, impList, members);} - throw new Error("Missing return statement in function"); - } - - final public List ExtendsList(boolean isInterface) throws ParseException { - boolean extendsMoreThanOne = false; - List ret = new LinkedList(); - ClassOrInterfaceType cit; - jj_consume_token(EXTENDS); - cit = ClassOrInterfaceType(); - ret.add(cit); - label_10: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[16] = jj_gen; - break label_10; - } - jj_consume_token(COMMA); - cit = ClassOrInterfaceType(); - ret.add(cit); extendsMoreThanOne = true; - } - if (extendsMoreThanOne && !isInterface) { - throwParseException(token, "A class cannot extend more than one other class"); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public List ImplementsList(boolean isInterface) throws ParseException { - List ret = new LinkedList(); - ClassOrInterfaceType cit; - jj_consume_token(IMPLEMENTS); - cit = ClassOrInterfaceType(); - ret.add(cit); - label_11: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[17] = jj_gen; - break label_11; - } - jj_consume_token(COMMA); - cit = ClassOrInterfaceType(); - ret.add(cit); - } - if (isInterface) { - throwParseException(token, "An interface cannot implement other interfaces"); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public EnumDeclaration EnumDeclaration(Modifier modifier) throws ParseException { - String name; - List impList = null; - EnumConstantDeclaration entry; - List entries = null; - BodyDeclaration member; - List members = null; - int line = modifier.beginLine; - int column = modifier.beginColumn; - jj_consume_token(ENUM); - if (line == -1) {line=token.beginLine; column=token.beginColumn;} - jj_consume_token(IDENTIFIER); - name = token.image; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IMPLEMENTS: - impList = ImplementsList(false); - break; - default: - jj_la1[18] = jj_gen; - ; - } - jj_consume_token(LBRACE); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IDENTIFIER: - case AT: - entries = new LinkedList(); - entry = EnumConstantDeclaration(); - entries.add(entry); - label_12: - while (true) { - if (jj_2_7(2)) { - ; - } else { - break label_12; - } - jj_consume_token(COMMA); - entry = EnumConstantDeclaration(); - entries.add(entry); - } - break; - default: - jj_la1[19] = jj_gen; - ; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COMMA: - jj_consume_token(COMMA); - break; - default: - jj_la1[20] = jj_gen; - ; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case SEMICOLON: - jj_consume_token(SEMICOLON); - label_13: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case CLASS: - case DOUBLE: - case ENUM: - case FINAL: - case FLOAT: - case INT: - case INTERFACE: - case LONG: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOID: - case VOLATILE: - case IDENTIFIER: - case LBRACE: - case SEMICOLON: - case AT: - case LT: - ; - break; - default: - jj_la1[21] = jj_gen; - break label_13; - } - member = ClassOrInterfaceBodyDeclaration(false); - members = add(members, member); - } - break; - default: - jj_la1[22] = jj_gen; - ; - } - jj_consume_token(RBRACE); - {if (true) return new EnumDeclaration(line, column, token.endLine, token.endColumn,popJavadoc(), modifier.modifiers, modifier.annotations, name, impList, entries, members);} - throw new Error("Missing return statement in function"); - } - - final public EnumConstantDeclaration EnumConstantDeclaration() throws ParseException { - List annotations = null; - AnnotationExpr ann; - String name; - List args = null; - List classBody = null; - int line = -1; - int column = -1; - pushJavadoc(); - label_14: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case AT: - ; - break; - default: - jj_la1[23] = jj_gen; - break label_14; - } - ann = Annotation(); - annotations = add(annotations, ann); if (line==-1){line=ann.getBeginLine(); column=ann.getBeginColumn();} - } - jj_consume_token(IDENTIFIER); - name = token.image; if (line==-1){line=token.beginLine; column=token.beginColumn;} - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LPAREN: - args = Arguments(); - break; - default: - jj_la1[24] = jj_gen; - ; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACE: - classBody = ClassOrInterfaceBody(false); - break; - default: - jj_la1[25] = jj_gen; - ; - } - {if (true) return new EnumConstantDeclaration(line, column, token.endLine, token.endColumn,popJavadoc(), annotations, name, args, classBody);} - throw new Error("Missing return statement in function"); - } - - final public List TypeParameters() throws ParseException { - List ret = new LinkedList(); - TypeParameter tp; - jj_consume_token(LT); - ret.add(new int[]{token.beginLine, token.beginColumn}); - tp = TypeParameter(); - ret.add(tp); - label_15: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[26] = jj_gen; - break label_15; - } - jj_consume_token(COMMA); - tp = TypeParameter(); - ret.add(tp); - } - jj_consume_token(GT); - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public TypeParameter TypeParameter() throws ParseException { - String name; - List annotations = null; - List typeBound = null; - int line; - int column; - annotations = Annotationsopt(); - jj_consume_token(IDENTIFIER); - name = token.image; line=token.beginLine; column=token.beginColumn; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case EXTENDS: - typeBound = TypeBound(); - break; - default: - jj_la1[27] = jj_gen; - ; - } - {if (true) return new TypeParameter(line, column, token.endLine, token.endColumn, name, annotations, typeBound);} - throw new Error("Missing return statement in function"); - } - - final public List TypeBound() throws ParseException { - List ret = new LinkedList(); - ClassOrInterfaceType cit; - jj_consume_token(EXTENDS); - cit = ClassOrInterfaceType(); - ret.add(cit); - label_16: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case BIT_AND: - ; - break; - default: - jj_la1[28] = jj_gen; - break label_16; - } - jj_consume_token(BIT_AND); - cit = ClassOrInterfaceType(); - ret.add(cit); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public List ClassOrInterfaceBody(boolean isInterface) throws ParseException { - List ret = new LinkedList(); - BodyDeclaration member; - jj_consume_token(LBRACE); - label_17: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case CLASS: - case DOUBLE: - case ENUM: - case FINAL: - case FLOAT: - case INT: - case INTERFACE: - case LONG: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOID: - case VOLATILE: - case IDENTIFIER: - case LBRACE: - case SEMICOLON: - case AT: - case LT: - ; - break; - default: - jj_la1[29] = jj_gen; - break label_17; - } - member = ClassOrInterfaceBodyDeclaration(isInterface); - ret.add(member); - } - jj_consume_token(RBRACE); - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public BodyDeclaration ClassOrInterfaceBodyDeclaration(boolean isInterface) throws ParseException { - boolean isNestedInterface = false; - Modifier modifier; - BodyDeclaration ret; - pushJavadoc(); - if (jj_2_10(2)) { - ret = InitializerDeclaration(); - if (isInterface) { - throwParseException(token, "An interface cannot have initializers"); - } - } else { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case CLASS: - case DOUBLE: - case ENUM: - case FINAL: - case FLOAT: - case INT: - case INTERFACE: - case LONG: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOID: - case VOLATILE: - case IDENTIFIER: - case AT: - case LT: - modifier = Modifiers(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case CLASS: - case INTERFACE: - ret = ClassOrInterfaceDeclaration(modifier); - break; - case ENUM: - ret = EnumDeclaration(modifier); - break; - case AT: - ret = AnnotationTypeDeclaration(modifier); - break; - default: - jj_la1[30] = jj_gen; - if (jj_2_8(2147483647)) { - ret = ConstructorDeclaration(modifier); - } else if (jj_2_9(2147483647)) { - ret = FieldDeclaration(modifier); - } else { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - case VOID: - case IDENTIFIER: - case AT: - case LT: - ret = MethodDeclaration(modifier); - break; - default: - jj_la1[31] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } - break; - case SEMICOLON: - jj_consume_token(SEMICOLON); - ret = new EmptyMemberDeclaration(token.beginLine, token.beginColumn, token.endLine, token.endColumn, popJavadoc()); - break; - default: - jj_la1[32] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public FieldDeclaration FieldDeclaration(Modifier modifier) throws ParseException { - Type type; - List variables = new LinkedList(); - VariableDeclarator val; - // Modifiers are already matched in the caller - type = UnType(); - val = VariableDeclarator(); - variables.add(val); - label_18: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[33] = jj_gen; - break label_18; - } - jj_consume_token(COMMA); - val = VariableDeclarator(); - variables.add(val); - } - jj_consume_token(SEMICOLON); - int line = modifier.beginLine; - int column = modifier.beginColumn; - if (line == -1) { line=type.getBeginLine(); column=type.getBeginColumn(); } - type.setAnnotations(modifier.annotations); - {if (true) return new FieldDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), modifier.modifiers, null, type, variables);} - throw new Error("Missing return statement in function"); - } - - final public VariableDeclarator VariableDeclarator() throws ParseException { - VariableDeclaratorId id; - Expression init = null; - id = VariableDeclaratorId(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case ASSIGN: - jj_consume_token(ASSIGN); - init = VariableInitializer(); - break; - default: - jj_la1[34] = jj_gen; - ; - } - {if (true) return new VariableDeclarator(id.getBeginLine(), id.getBeginColumn(), token.endLine, token.endColumn, id, init);} - throw new Error("Missing return statement in function"); - } - - final public VariableDeclaratorId VariableDeclaratorId() throws ParseException { - String name; - int arrayCount = 0; - int line; - int column; - jj_consume_token(IDENTIFIER); - name = token.image; line=token.beginLine; column=token.beginColumn; - label_19: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACKET: - ; - break; - default: - jj_la1[35] = jj_gen; - break label_19; - } - jj_consume_token(LBRACKET); - jj_consume_token(RBRACKET); - arrayCount++; - } - {if (true) return new VariableDeclaratorId(line, column, token.endLine, token.endColumn,name, arrayCount);} - throw new Error("Missing return statement in function"); - } - - final public Expression VariableInitializer() throws ParseException { - Expression ret; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACE: - ret = ArrayInitializer(); - break; - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - ret = Expression(); - break; - default: - jj_la1[36] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public ArrayInitializerExpr ArrayInitializer() throws ParseException { - List values = null; - Expression val; - int line; - int column; - jj_consume_token(LBRACE); - line=token.beginLine; column=token.beginColumn; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case LBRACE: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - val = VariableInitializer(); - values = add(values, val); - label_20: - while (true) { - if (jj_2_11(2)) { - ; - } else { - break label_20; - } - jj_consume_token(COMMA); - val = VariableInitializer(); - values = add(values, val); - } - break; - default: - jj_la1[37] = jj_gen; - ; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COMMA: - jj_consume_token(COMMA); - break; - default: - jj_la1[38] = jj_gen; - ; - } - jj_consume_token(RBRACE); - {if (true) return new ArrayInitializerExpr(line, column, token.endLine, token.endColumn,values);} - throw new Error("Missing return statement in function"); - } - - final public MethodDeclaration MethodDeclaration(Modifier modifier) throws ParseException { - List typeParameters = null; - Type type; - String name; - List parameters; - int arrayCount = 0; - List annotations = null; - List receiverAnnotations = null; - List throws_ = null; - BlockStmt block = null; - int line = modifier.beginLine; - int column = modifier.beginColumn; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LT: - typeParameters = TypeParameters(); - int[] lineCol=(int[])typeParameters.remove(0); if (line==-1){ line=lineCol[0]; column=lineCol[1];} - break; - default: - jj_la1[39] = jj_gen; - ; - } - annotations = Annotationsopt(); - type = UnResultType(); - if (line==-1){line=type.getBeginLine(); column=type.getBeginColumn();} - jj_consume_token(IDENTIFIER); - name = token.image; - parameters = FormalParameters(); - label_21: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACKET: - ; - break; - default: - jj_la1[40] = jj_gen; - break label_21; - } - jj_consume_token(LBRACKET); - jj_consume_token(RBRACKET); - arrayCount++; - } - receiverAnnotations = Annotationsopt(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case THROWS: - jj_consume_token(THROWS); - throws_ = NameList(); - break; - default: - jj_la1[41] = jj_gen; - ; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACE: - block = Block(); - break; - case SEMICOLON: - jj_consume_token(SEMICOLON); - break; - default: - jj_la1[42] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - if (annotations == null) { - annotations = modifier.annotations; - } else if (modifier.annotations != null) { - annotations.addAll(0, modifier.annotations); - } - type.setAnnotations(annotations); - {if (true) return new MethodDeclaration(line, column, token.endLine, token.endColumn,popJavadoc(), modifier.modifiers, null, typeParameters, type, name, parameters, arrayCount, receiverAnnotations, throws_, block);} - throw new Error("Missing return statement in function"); - } - - final public List FormalParameters() throws ParseException { - List ret = null; - Parameter par; - jj_consume_token(LPAREN); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FINAL: - case FLOAT: - case INT: - case LONG: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOLATILE: - case IDENTIFIER: - case AT: - par = FormalParameter(); - ret = add(ret, par); - label_22: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[43] = jj_gen; - break label_22; - } - jj_consume_token(COMMA); - par = FormalParameter(); - ret = add(ret, par); - } - break; - default: - jj_la1[44] = jj_gen; - ; - } - jj_consume_token(RPAREN); - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Parameter FormalParameter() throws ParseException { - Modifier modifier; - Type type; - boolean isVarArg = false; - List varArgAnnotations = null; - VariableDeclaratorId id; - modifier = Modifiers(); - type = UnType(); - if (jj_2_12(2147483647)) { - varArgAnnotations = Annotationsopt(); - jj_consume_token(ELLIPSIS); - isVarArg = true; - } else { - ; - } - id = VariableDeclaratorId(); - int line = modifier.beginLine; - int column = modifier.beginColumn; - if (line==-1){ line=type.getBeginLine(); column=type.getBeginColumn(); } - type.setAnnotations(modifier.annotations); - {if (true) return new Parameter(line, column, token.endLine, token.endColumn, modifier.modifiers, null, type, isVarArg, id);} - throw new Error("Missing return statement in function"); - } - - final public ConstructorDeclaration ConstructorDeclaration(Modifier modifier) throws ParseException { - List typeParameters = null; - String name; - List parameters; - List receiverAnnotations; - List throws_ = null; - ExplicitConstructorInvocationStmt exConsInv = null; - List stmts = null; - int line = modifier.beginLine; - int column = modifier.beginColumn; - int bbLine = 0; - int bbColumn = 0; - int beLine = 0; - int beColumn = 0; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LT: - typeParameters = TypeParameters(); - int[] lineCol=(int[])typeParameters.remove(0); if (line==-1){ line=lineCol[0]; column=lineCol[1];} - break; - default: - jj_la1[45] = jj_gen; - ; - } - jj_consume_token(IDENTIFIER); - name = token.image; if (line==-1){line=token.beginLine; column=token.beginColumn;} - parameters = FormalParameters(); - receiverAnnotations = Annotationsopt(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case THROWS: - jj_consume_token(THROWS); - throws_ = NameList(); - break; - default: - jj_la1[46] = jj_gen; - ; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACE: - jj_consume_token(LBRACE); - bbLine=token.beginLine; bbColumn=token.beginColumn; - if (jj_2_13(2147483647)) { - exConsInv = ExplicitConstructorInvocation(); - } else { - ; - } - stmts = Statements(); - jj_consume_token(RBRACE); - break; - case SEMICOLON: - jj_consume_token(SEMICOLON); - break; - default: - jj_la1[47] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - if (exConsInv != null) { - stmts = add(0, stmts, exConsInv); - } - {if (true) return new ConstructorDeclaration(line, column, token.endLine, token.endColumn,popJavadoc(), modifier.modifiers, modifier.annotations, typeParameters, name, parameters, receiverAnnotations, throws_, new BlockStmt(bbLine, bbColumn, token.endLine, token.endColumn, stmts));} - throw new Error("Missing return statement in function"); - } - - final public ExplicitConstructorInvocationStmt ExplicitConstructorInvocation() throws ParseException { - boolean isThis = false; - List args; - Expression expr = null; - List typeArgs = null; - int line = -1; - int column = 0; - if (jj_2_15(2147483647)) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LT: - typeArgs = TypeArguments(); - int[] lineCol=(int[])typeArgs.remove(0); line=lineCol[0]; column=lineCol[1]; - break; - default: - jj_la1[48] = jj_gen; - ; - } - jj_consume_token(THIS); - if (line == -1) {line=token.beginLine; column=token.beginColumn;} isThis = true; - args = Arguments(); - jj_consume_token(SEMICOLON); - } else { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case LT: - if (jj_2_14(2147483647)) { - expr = PrimaryExpressionWithoutSuperSuffix(); - jj_consume_token(DOT); - line=expr.getBeginLine(); column=expr.getBeginColumn(); - } else { - ; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LT: - typeArgs = TypeArguments(); - int[] lineCol=(int[])typeArgs.remove(0); if (line == -1) {line=lineCol[0]; column=lineCol[1];} - break; - default: - jj_la1[49] = jj_gen; - ; - } - jj_consume_token(SUPER); - if (line == -1) {line=token.beginLine; column=token.beginColumn;} - args = Arguments(); - jj_consume_token(SEMICOLON); - break; - default: - jj_la1[50] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - {if (true) return new ExplicitConstructorInvocationStmt(line, column, token.endLine, token.endColumn,typeArgs, isThis, expr, args);} - throw new Error("Missing return statement in function"); - } - - final public List Statements() throws ParseException { - List ret = null; - Statement stmt; - label_23: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case ABSTRACT: - case ASSERT: - case BOOLEAN: - case BREAK: - case BYTE: - case CHAR: - case CLASS: - case CONTINUE: - case DO: - case DOUBLE: - case FALSE: - case FINAL: - case FLOAT: - case FOR: - case IF: - case INT: - case INTERFACE: - case LONG: - case NATIVE: - case NEW: - case NULL: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case RETURN: - case SHORT: - case STATIC: - case STRICTFP: - case SUPER: - case SWITCH: - case SYNCHRONIZED: - case THIS: - case THROW: - case TRANSIENT: - case TRUE: - case TRY: - case VOID: - case VOLATILE: - case WHILE: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case LBRACE: - case SEMICOLON: - case AT: - case INCR: - case DECR: - ; - break; - default: - jj_la1[51] = jj_gen; - break label_23; - } - stmt = BlockStatement(); - ret = add(ret, stmt); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public InitializerDeclaration InitializerDeclaration() throws ParseException { - BlockStmt block; - int line = -1; - int column = 0; - boolean isStatic = false; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case STATIC: - jj_consume_token(STATIC); - isStatic = true; line=token.beginLine; column=token.beginColumn; - break; - default: - jj_la1[52] = jj_gen; - ; - } - block = Block(); - if (line==-1){line=block.getBeginLine(); column=block.getBeginColumn();} - {if (true) return new InitializerDeclaration(line, column, token.endLine, token.endColumn,popJavadoc(), isStatic, block);} - throw new Error("Missing return statement in function"); - } - -/* - * Type, name and expression syntax follows. - */ - final public Type Type() throws ParseException { - Type ret; - if (jj_2_16(2)) { - ret = ReferenceType(); - } else { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - case AT: - ret = PrimitiveType(); - break; - default: - jj_la1[53] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public ReferenceType ReferenceType() throws ParseException { - Type type; - int arrayCount = 0; - List annotations; - List arrayAnnotations = new LinkedList(); - List levelAnn; - annotations = Annotationsopt(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - type = UnPrimitiveType(); - label_24: - while (true) { - levelAnn = Annotationsopt(); - jj_consume_token(LBRACKET); - jj_consume_token(RBRACKET); - arrayCount++; arrayAnnotations.add(levelAnn); - if (jj_2_17(2147483647)) { - ; - } else { - break label_24; - } - } - break; - case IDENTIFIER: - type = UnClassOrInterfaceType(); - label_25: - while (true) { - if (jj_2_18(2147483647)) { - ; - } else { - break label_25; - } - levelAnn = Annotationsopt(); - jj_consume_token(LBRACKET); - jj_consume_token(RBRACKET); - arrayCount++; arrayAnnotations.add(levelAnn); - } - break; - default: - jj_la1[54] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - ReferenceType ret = new ReferenceType(type.getBeginLine(), type.getBeginColumn(), token.endLine, token.endColumn, type, arrayCount, arrayAnnotations); - ret.setAnnotations(annotations); - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public ClassOrInterfaceType ClassOrInterfaceType() throws ParseException { - ClassOrInterfaceType ret; - String name; - List typeArgs = null; - int line; - int column; - List annotations; - annotations = Annotationsopt(); - jj_consume_token(IDENTIFIER); - line=token.beginLine; column=token.beginColumn; - name = token.image; - if (jj_2_19(2)) { - typeArgs = TypeArguments(); - typeArgs.remove(0); - } else { - ; - } - ret = new ClassOrInterfaceType(line, column, token.endLine, token.endColumn,null, name, typeArgs); - label_26: - while (true) { - if (jj_2_20(2)) { - ; - } else { - break label_26; - } - jj_consume_token(DOT); - jj_consume_token(IDENTIFIER); - name = token.image; - if (jj_2_21(2)) { - typeArgs = TypeArguments(); - typeArgs.remove(0); - } else { - ; - } - ret = new ClassOrInterfaceType(line, column, token.endLine, token.endColumn,ret, name, typeArgs); - } - ret.setAnnotations(annotations); {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public List TypeArguments() throws ParseException { - List ret = new LinkedList(); - Type type; - jj_consume_token(LT); - ret.add(new int[]{token.beginLine, token.beginColumn}); - type = TypeArgument(); - ret.add(type); - label_27: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[55] = jj_gen; - break label_27; - } - jj_consume_token(COMMA); - type = TypeArgument(); - ret.add(type); - } - jj_consume_token(GT); - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Type TypeArgument() throws ParseException { - Type ret; - List annotations = new LinkedList(); - annotations = Annotationsopt(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - case IDENTIFIER: - ret = UnReferenceType(); - break; - case HOOK: - ret = UnWildcard(); - break; - default: - jj_la1[56] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - ret.setAnnotations(annotations); {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public WildcardType Wildcard() throws ParseException { - ReferenceType ext = null; - ReferenceType sup = null; - int line; - int column; - List annotations; - annotations = Annotationsopt(); - jj_consume_token(HOOK); - line=token.beginLine; column=token.beginColumn; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case EXTENDS: - case SUPER: - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case EXTENDS: - jj_consume_token(EXTENDS); - ext = ReferenceType(); - break; - case SUPER: - jj_consume_token(SUPER); - sup = ReferenceType(); - break; - default: - jj_la1[57] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - default: - jj_la1[58] = jj_gen; - ; - } - WildcardType ret = new WildcardType(line, column, token.endLine, token.endColumn,ext, sup); - ret.setAnnotations(annotations); - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public PrimitiveType PrimitiveType() throws ParseException { - PrimitiveType ret; - List annotations; - annotations = Annotationsopt(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case BOOLEAN: - jj_consume_token(BOOLEAN); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Boolean); - break; - case CHAR: - jj_consume_token(CHAR); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Char); - break; - case BYTE: - jj_consume_token(BYTE); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Byte); - break; - case SHORT: - jj_consume_token(SHORT); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Short); - break; - case INT: - jj_consume_token(INT); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Int); - break; - case LONG: - jj_consume_token(LONG); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Long); - break; - case FLOAT: - jj_consume_token(FLOAT); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Float); - break; - case DOUBLE: - jj_consume_token(DOUBLE); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Double); - break; - default: - jj_la1[59] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - ret.setAnnotations(annotations); {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Type ResultType() throws ParseException { - Type ret; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case VOID: - jj_consume_token(VOID); - ret = new VoidType(token.beginLine, token.beginColumn, token.endLine, token.endColumn); - break; - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - case IDENTIFIER: - case AT: - ret = Type(); - break; - default: - jj_la1[60] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - -/* - * Unannotated Type, name and expression syntax follows. - */ - final public Type UnType() throws ParseException { - Type ret; - if (jj_2_22(2)) { - ret = UnReferenceType(); - } else { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - ret = UnPrimitiveType(); - break; - default: - jj_la1[61] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public ReferenceType UnReferenceType() throws ParseException { - Type type; - int arrayCount = 0; - List arrayAnnotations = new LinkedList(); - List levelAnn; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - type = UnPrimitiveType(); - label_28: - while (true) { - levelAnn = Annotationsopt(); - jj_consume_token(LBRACKET); - jj_consume_token(RBRACKET); - arrayCount++; arrayAnnotations.add(levelAnn); - if (jj_2_23(2147483647)) { - ; - } else { - break label_28; - } - } - break; - case IDENTIFIER: - type = UnClassOrInterfaceType(); - label_29: - while (true) { - if (jj_2_24(2147483647)) { - ; - } else { - break label_29; - } - levelAnn = Annotationsopt(); - jj_consume_token(LBRACKET); - jj_consume_token(RBRACKET); - arrayCount++; arrayAnnotations.add(levelAnn); - } - break; - default: - jj_la1[62] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - {if (true) return new ReferenceType(type.getBeginLine(), type.getBeginColumn(), token.endLine, token.endColumn, type, arrayCount, arrayAnnotations);} - throw new Error("Missing return statement in function"); - } - - final public ClassOrInterfaceType UnClassOrInterfaceType() throws ParseException { - ClassOrInterfaceType ret; - String name; - List typeArgs = null; - int line; - int column; - jj_consume_token(IDENTIFIER); - line=token.beginLine; column=token.beginColumn; - name = token.image; - if (jj_2_25(2)) { - typeArgs = TypeArguments(); - typeArgs.remove(0); - } else { - ; - } - ret = new ClassOrInterfaceType(line, column, token.endLine, token.endColumn,null, name, typeArgs); - label_30: - while (true) { - if (jj_2_26(2)) { - ; - } else { - break label_30; - } - jj_consume_token(DOT); - jj_consume_token(IDENTIFIER); - name = token.image; - if (jj_2_27(2)) { - typeArgs = TypeArguments(); - typeArgs.remove(0); - } else { - ; - } - ret = new ClassOrInterfaceType(line, column, token.endLine, token.endColumn,ret, name, typeArgs); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public PrimitiveType UnPrimitiveType() throws ParseException { - PrimitiveType ret; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case BOOLEAN: - jj_consume_token(BOOLEAN); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Boolean); - break; - case CHAR: - jj_consume_token(CHAR); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Char); - break; - case BYTE: - jj_consume_token(BYTE); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Byte); - break; - case SHORT: - jj_consume_token(SHORT); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Short); - break; - case INT: - jj_consume_token(INT); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Int); - break; - case LONG: - jj_consume_token(LONG); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Long); - break; - case FLOAT: - jj_consume_token(FLOAT); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Float); - break; - case DOUBLE: - jj_consume_token(DOUBLE); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Double); - break; - default: - jj_la1[63] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public WildcardType UnWildcard() throws ParseException { - ReferenceType ext = null; - ReferenceType sup = null; - int line; - int column; - jj_consume_token(HOOK); - line=token.beginLine; column=token.beginColumn; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case EXTENDS: - case SUPER: - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case EXTENDS: - jj_consume_token(EXTENDS); - ext = ReferenceType(); - break; - case SUPER: - jj_consume_token(SUPER); - sup = ReferenceType(); - break; - default: - jj_la1[64] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - default: - jj_la1[65] = jj_gen; - ; - } - {if (true) return new WildcardType(line, column, token.endLine, token.endColumn,ext, sup);} - throw new Error("Missing return statement in function"); - } - - final public Type UnResultType() throws ParseException { - Type ret; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case VOID: - jj_consume_token(VOID); - ret = new VoidType(token.beginLine, token.beginColumn, token.endLine, token.endColumn); - break; - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - case IDENTIFIER: - ret = UnType(); - break; - default: - jj_la1[66] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public NameExpr Name() throws ParseException { - NameExpr ret; - jj_consume_token(IDENTIFIER); - ret = new NameExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); - label_31: - while (true) { - if (jj_2_28(2)) { - ; - } else { - break label_31; - } - jj_consume_token(DOT); - jj_consume_token(IDENTIFIER); - ret = new QualifiedNameExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, token.image); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public List NameList() throws ParseException { - List ret = new LinkedList(); - NameExpr name; - name = Name(); - ret.add(name); - label_32: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[67] = jj_gen; - break label_32; - } - jj_consume_token(COMMA); - name = Name(); - ret.add(name); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - -/* - * Expression syntax follows. - */ - final public Expression Expression() throws ParseException { - Expression ret; - AssignExpr.Operator op; - Expression value; - ret = ConditionalExpression(); - if (jj_2_29(2)) { - op = AssignmentOperator(); - value = Expression(); - ret = new AssignExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, value, op); - } else { - ; - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public AssignExpr.Operator AssignmentOperator() throws ParseException { - AssignExpr.Operator ret; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case ASSIGN: - jj_consume_token(ASSIGN); - ret = AssignExpr.Operator.assign; - break; - case STARASSIGN: - jj_consume_token(STARASSIGN); - ret = AssignExpr.Operator.star; - break; - case SLASHASSIGN: - jj_consume_token(SLASHASSIGN); - ret = AssignExpr.Operator.slash; - break; - case REMASSIGN: - jj_consume_token(REMASSIGN); - ret = AssignExpr.Operator.rem; - break; - case PLUSASSIGN: - jj_consume_token(PLUSASSIGN); - ret = AssignExpr.Operator.plus; - break; - case MINUSASSIGN: - jj_consume_token(MINUSASSIGN); - ret = AssignExpr.Operator.minus; - break; - case LSHIFTASSIGN: - jj_consume_token(LSHIFTASSIGN); - ret = AssignExpr.Operator.lShift; - break; - case RSIGNEDSHIFTASSIGN: - jj_consume_token(RSIGNEDSHIFTASSIGN); - ret = AssignExpr.Operator.rSignedShift; - break; - case RUNSIGNEDSHIFTASSIGN: - jj_consume_token(RUNSIGNEDSHIFTASSIGN); - ret = AssignExpr.Operator.rUnsignedShift; - break; - case ANDASSIGN: - jj_consume_token(ANDASSIGN); - ret = AssignExpr.Operator.and; - break; - case XORASSIGN: - jj_consume_token(XORASSIGN); - ret = AssignExpr.Operator.xor; - break; - case ORASSIGN: - jj_consume_token(ORASSIGN); - ret = AssignExpr.Operator.or; - break; - default: - jj_la1[68] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Expression ConditionalExpression() throws ParseException { - Expression ret; - Expression left; - Expression right; - ret = ConditionalOrExpression(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case HOOK: - jj_consume_token(HOOK); - left = Expression(); - jj_consume_token(COLON); - right = ConditionalExpression(); - ret = new ConditionalExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, left, right); - break; - default: - jj_la1[69] = jj_gen; - ; - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Expression ConditionalOrExpression() throws ParseException { - Expression ret; - Expression right; - ret = ConditionalAndExpression(); - label_33: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case SC_OR: - ; - break; - default: - jj_la1[70] = jj_gen; - break label_33; - } - jj_consume_token(SC_OR); - right = ConditionalAndExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.or); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Expression ConditionalAndExpression() throws ParseException { - Expression ret; - Expression right; - ret = InclusiveOrExpression(); - label_34: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case SC_AND: - ; - break; - default: - jj_la1[71] = jj_gen; - break label_34; - } - jj_consume_token(SC_AND); - right = InclusiveOrExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.and); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Expression InclusiveOrExpression() throws ParseException { - Expression ret; - Expression right; - ret = ExclusiveOrExpression(); - label_35: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case BIT_OR: - ; - break; - default: - jj_la1[72] = jj_gen; - break label_35; - } - jj_consume_token(BIT_OR); - right = ExclusiveOrExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.binOr); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Expression ExclusiveOrExpression() throws ParseException { - Expression ret; - Expression right; - ret = AndExpression(); - label_36: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case XOR: - ; - break; - default: - jj_la1[73] = jj_gen; - break label_36; - } - jj_consume_token(XOR); - right = AndExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.xor); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Expression AndExpression() throws ParseException { - Expression ret; - Expression right; - ret = EqualityExpression(); - label_37: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case BIT_AND: - ; - break; - default: - jj_la1[74] = jj_gen; - break label_37; - } - jj_consume_token(BIT_AND); - right = EqualityExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.binAnd); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Expression EqualityExpression() throws ParseException { - Expression ret; - Expression right; - BinaryExpr.Operator op; - ret = InstanceOfExpression(); - label_38: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case EQ: - case NE: - ; - break; - default: - jj_la1[75] = jj_gen; - break label_38; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case EQ: - jj_consume_token(EQ); - op = BinaryExpr.Operator.equals; - break; - case NE: - jj_consume_token(NE); - op = BinaryExpr.Operator.notEquals; - break; - default: - jj_la1[76] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - right = InstanceOfExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Expression InstanceOfExpression() throws ParseException { - Expression ret; - Type type; - ret = RelationalExpression(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case INSTANCEOF: - jj_consume_token(INSTANCEOF); - type = Type(); - ret = new InstanceOfExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, type); - break; - default: - jj_la1[77] = jj_gen; - ; - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Expression RelationalExpression() throws ParseException { - Expression ret; - Expression right; - BinaryExpr.Operator op; - ret = ShiftExpression(); - label_39: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LT: - case LE: - case GE: - case GT: - ; - break; - default: - jj_la1[78] = jj_gen; - break label_39; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LT: - jj_consume_token(LT); - op = BinaryExpr.Operator.less; - break; - case GT: - jj_consume_token(GT); - op = BinaryExpr.Operator.greater; - break; - case LE: - jj_consume_token(LE); - op = BinaryExpr.Operator.lessEquals; - break; - case GE: - jj_consume_token(GE); - op = BinaryExpr.Operator.greaterEquals; - break; - default: - jj_la1[79] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - right = ShiftExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Expression ShiftExpression() throws ParseException { - Expression ret; - Expression right; - BinaryExpr.Operator op; - ret = AdditiveExpression(); - label_40: - while (true) { - if (jj_2_30(1)) { - ; - } else { - break label_40; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LSHIFT: - jj_consume_token(LSHIFT); - op = BinaryExpr.Operator.lShift; - break; - default: - jj_la1[80] = jj_gen; - if (jj_2_31(1)) { - RSIGNEDSHIFT(); - op = BinaryExpr.Operator.rSignedShift; - } else if (jj_2_32(1)) { - RUNSIGNEDSHIFT(); - op = BinaryExpr.Operator.rUnsignedShift; - } else { - jj_consume_token(-1); - throw new ParseException(); - } - } - right = AdditiveExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Expression AdditiveExpression() throws ParseException { - Expression ret; - Expression right; - BinaryExpr.Operator op; - ret = MultiplicativeExpression(); - label_41: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case PLUS: - case MINUS: - ; - break; - default: - jj_la1[81] = jj_gen; - break label_41; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case PLUS: - jj_consume_token(PLUS); - op = BinaryExpr.Operator.plus; - break; - case MINUS: - jj_consume_token(MINUS); - op = BinaryExpr.Operator.minus; - break; - default: - jj_la1[82] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - right = MultiplicativeExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Expression MultiplicativeExpression() throws ParseException { - Expression ret; - Expression right; - BinaryExpr.Operator op; - ret = UnaryExpression(); - label_42: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case STAR: - case SLASH: - case REM: - ; - break; - default: - jj_la1[83] = jj_gen; - break label_42; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case STAR: - jj_consume_token(STAR); - op = BinaryExpr.Operator.times; - break; - case SLASH: - jj_consume_token(SLASH); - op = BinaryExpr.Operator.divide; - break; - case REM: - jj_consume_token(REM); - op = BinaryExpr.Operator.remainder; - break; - default: - jj_la1[84] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - right = UnaryExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Expression UnaryExpression() throws ParseException { - Expression ret; - UnaryExpr.Operator op; - int line = 0; - int column = 0; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case INCR: - ret = PreIncrementExpression(); - break; - case DECR: - ret = PreDecrementExpression(); - break; - case PLUS: - case MINUS: - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case PLUS: - jj_consume_token(PLUS); - op = UnaryExpr.Operator.positive; line=token.beginLine; column=token.beginColumn; - break; - case MINUS: - jj_consume_token(MINUS); - op = UnaryExpr.Operator.negative; line=token.beginLine; column=token.beginColumn; - break; - default: - jj_la1[85] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - ret = UnaryExpression(); - if (op == UnaryExpr.Operator.negative) { - if (ret instanceof IntegerLiteralExpr && ((IntegerLiteralExpr)ret).isMinValue()) { - ret = new IntegerLiteralMinValueExpr(line, column, token.endLine, token.endColumn); - } else if (ret instanceof LongLiteralExpr && ((LongLiteralExpr)ret).isMinValue()) { - ret = new LongLiteralMinValueExpr(line, column, token.endLine, token.endColumn); - } else { - ret = new UnaryExpr(line, column, token.endLine, token.endColumn,ret, op); - } - } else { - ret = new UnaryExpr(line, column, token.endLine, token.endColumn,ret, op); - } - break; - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - ret = UnaryExpressionNotPlusMinus(); - break; - default: - jj_la1[86] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Expression PreIncrementExpression() throws ParseException { - Expression ret; - int line; - int column; - jj_consume_token(INCR); - line=token.beginLine; column=token.beginColumn; - ret = UnaryExpression(); - ret = new UnaryExpr(line, column, token.endLine, token.endColumn,ret, UnaryExpr.Operator.preIncrement); - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Expression PreDecrementExpression() throws ParseException { - Expression ret; - int line; - int column; - jj_consume_token(DECR); - line=token.beginLine; column=token.beginColumn; - ret = UnaryExpression(); - ret = new UnaryExpr(line, column, token.endLine, token.endColumn,ret, UnaryExpr.Operator.preDecrement); - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Expression UnaryExpressionNotPlusMinus() throws ParseException { - Expression ret; - UnaryExpr.Operator op; - int line = 0; - int column = 0; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case BANG: - case TILDE: - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case TILDE: - jj_consume_token(TILDE); - op = UnaryExpr.Operator.inverse; line=token.beginLine; column=token.beginColumn; - break; - case BANG: - jj_consume_token(BANG); - op = UnaryExpr.Operator.not; line=token.beginLine; column=token.beginColumn; - break; - default: - jj_la1[87] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - ret = UnaryExpression(); - ret = new UnaryExpr(line, column, token.endLine, token.endColumn,ret, op); - break; - default: - jj_la1[88] = jj_gen; - if (jj_2_33(2147483647)) { - ret = CastExpression(); - } else { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - ret = PostfixExpression(); - break; - default: - jj_la1[89] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Expression PostfixExpression() throws ParseException { - Expression ret; - UnaryExpr.Operator op; - ret = PrimaryExpression(); - if (jj_2_34(2)) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case INCR: - jj_consume_token(INCR); - op = UnaryExpr.Operator.posIncrement; - break; - case DECR: - jj_consume_token(DECR); - op = UnaryExpr.Operator.posDecrement; - break; - default: - jj_la1[90] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - ret = new UnaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, op); - } else { - ; - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Expression CastExpression() throws ParseException { - Expression ret; - Type type; - int line; - int column; - jj_consume_token(LPAREN); - line=token.beginLine; column=token.beginColumn; - if (jj_2_35(2)) { - type = PrimitiveType(); - jj_consume_token(RPAREN); - ret = UnaryExpression(); - ret = new CastExpr(line, column, token.endLine, token.endColumn,type, ret); - } else { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - case IDENTIFIER: - case AT: - type = ReferenceType(); - jj_consume_token(RPAREN); - ret = UnaryExpressionNotPlusMinus(); - ret = new CastExpr(line, column, token.endLine, token.endColumn,type, ret); - break; - default: - jj_la1[91] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Expression PrimaryExpression() throws ParseException { - Expression ret; - Expression inner; - ret = PrimaryPrefix(); - label_43: - while (true) { - if (jj_2_36(2)) { - ; - } else { - break label_43; - } - ret = PrimarySuffix(ret); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Expression PrimaryExpressionWithoutSuperSuffix() throws ParseException { - Expression ret; - Expression inner; - ret = PrimaryPrefix(); - label_44: - while (true) { - if (jj_2_37(2147483647)) { - ; - } else { - break label_44; - } - ret = PrimarySuffixWithoutSuper(ret); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Expression PrimaryPrefix() throws ParseException { - Expression ret; - String name; - List typeArgs = null; - List args = null; - boolean hasArgs = false; - Type type; - int line; - int column; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case FALSE: - case NULL: - case TRUE: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - ret = Literal(); - break; - case THIS: - jj_consume_token(THIS); - ret = new ThisExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, null); - break; - case SUPER: - jj_consume_token(SUPER); - ret = new SuperExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, null); - jj_consume_token(DOT); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LT: - typeArgs = TypeArguments(); - typeArgs.remove(0); - break; - default: - jj_la1[92] = jj_gen; - ; - } - jj_consume_token(IDENTIFIER); - name = token.image; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LPAREN: - args = Arguments(); - hasArgs=true; - break; - default: - jj_la1[93] = jj_gen; - ; - } - ret = hasArgs - ? new MethodCallExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, typeArgs, name, args) - : new FieldAccessExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, null, name); - break; - case LPAREN: - jj_consume_token(LPAREN); - line=token.beginLine; column=token.beginColumn; - ret = Expression(); - jj_consume_token(RPAREN); - ret = new EnclosedExpr(line, column, token.endLine, token.endColumn,ret); - break; - case NEW: - ret = AllocationExpression(null); - break; - default: - jj_la1[95] = jj_gen; - if (jj_2_38(2147483647)) { - type = UnResultType(); - jj_consume_token(DOT); - jj_consume_token(CLASS); - ret = new ClassExpr(type.getBeginLine(), type.getBeginColumn(), token.endLine, token.endColumn, type); - } else { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IDENTIFIER: - jj_consume_token(IDENTIFIER); - name = token.image; line=token.beginLine; column=token.beginColumn; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LPAREN: - args = Arguments(); - hasArgs=true; - break; - default: - jj_la1[94] = jj_gen; - ; - } - ret = hasArgs - ? new MethodCallExpr(line, column, token.endLine, token.endColumn, null, null, name, args) - : new NameExpr(line, column, token.endLine, token.endColumn, name); - break; - default: - jj_la1[96] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Expression PrimarySuffix(Expression scope) throws ParseException { - Expression ret; - if (jj_2_39(2)) { - ret = PrimarySuffixWithoutSuper(scope); - } else { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case DOT: - jj_consume_token(DOT); - jj_consume_token(SUPER); - ret = new SuperExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope); - break; - default: - jj_la1[97] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Expression PrimarySuffixWithoutSuper(Expression scope) throws ParseException { - Expression ret; - List typeArgs = null; - List args = null; - boolean hasArgs = false; - String name; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case DOT: - jj_consume_token(DOT); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case THIS: - jj_consume_token(THIS); - ret = new ThisExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope); - break; - case NEW: - ret = AllocationExpression(scope); - break; - default: - jj_la1[100] = jj_gen; - if (jj_2_40(2147483647)) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LT: - typeArgs = TypeArguments(); - typeArgs.remove(0); - break; - default: - jj_la1[98] = jj_gen; - ; - } - jj_consume_token(IDENTIFIER); - name = token.image; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LPAREN: - args = Arguments(); - hasArgs=true; - break; - default: - jj_la1[99] = jj_gen; - ; - } - ret = hasArgs - ? new MethodCallExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope, typeArgs, name, args) - : new FieldAccessExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope, typeArgs, name); - } else { - jj_consume_token(-1); - throw new ParseException(); - } - } - break; - case LBRACKET: - jj_consume_token(LBRACKET); - ret = Expression(); - jj_consume_token(RBRACKET); - ret = new ArrayAccessExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope, ret); - break; - default: - jj_la1[101] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Expression Literal() throws ParseException { - Expression ret; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case INTEGER_LITERAL: - jj_consume_token(INTEGER_LITERAL); - ret = new IntegerLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); - break; - case LONG_LITERAL: - jj_consume_token(LONG_LITERAL); - ret = new LongLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); - break; - case FLOATING_POINT_LITERAL: - jj_consume_token(FLOATING_POINT_LITERAL); - ret = new DoubleLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); - break; - case CHARACTER_LITERAL: - jj_consume_token(CHARACTER_LITERAL); - ret = new CharLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image.substring(1, token.image.length()-1)); - break; - case STRING_LITERAL: - jj_consume_token(STRING_LITERAL); - ret = new StringLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image.substring(1, token.image.length()-1)); - break; - case FALSE: - case TRUE: - ret = BooleanLiteral(); - break; - case NULL: - ret = NullLiteral(); - break; - default: - jj_la1[102] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Expression BooleanLiteral() throws ParseException { - Expression ret; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case TRUE: - jj_consume_token(TRUE); - ret = new BooleanLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, true); - break; - case FALSE: - jj_consume_token(FALSE); - ret = new BooleanLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, false); - break; - default: - jj_la1[103] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Expression NullLiteral() throws ParseException { - jj_consume_token(NULL); - {if (true) return new NullLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn);} - throw new Error("Missing return statement in function"); - } - - final public List Arguments() throws ParseException { - List ret = null; - jj_consume_token(LPAREN); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - ret = ArgumentList(); - break; - default: - jj_la1[104] = jj_gen; - ; - } - jj_consume_token(RPAREN); - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public List ArgumentList() throws ParseException { - List ret = new LinkedList(); - Expression expr; - expr = Expression(); - ret.add(expr); - label_45: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[105] = jj_gen; - break label_45; - } - jj_consume_token(COMMA); - expr = Expression(); - ret.add(expr); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Expression AllocationExpression(Expression scope) throws ParseException { - Expression ret; - Type type; - Object[] arr = null; - List typeArgs = null; - List anonymousBody = null; - List args; - int line; - int column; - jj_consume_token(NEW); - if (scope==null) {line=token.beginLine; column=token.beginColumn;} else {line=scope.getBeginLine(); column=scope.getBeginColumn();} - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - type = UnPrimitiveType(); - arr = ArrayDimsAndInits(); - if (arr[0] instanceof Integer) { - ret = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, ((Integer)arr[0]).intValue(), (ArrayInitializerExpr)arr[1]); - } else { - ret = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, (List)arr[0], ((Integer)arr[1]).intValue()); - } - break; - case IDENTIFIER: - case LT: - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LT: - typeArgs = TypeArguments(); - typeArgs.remove(0); - break; - default: - jj_la1[106] = jj_gen; - ; - } - type = UnClassOrInterfaceType(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACKET: - arr = ArrayDimsAndInits(); - if (arr[0] instanceof Integer) { - ret = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, ((Integer)arr[0]).intValue(), (ArrayInitializerExpr)arr[1]); - } else { - ret = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, (List)arr[0], ((Integer)arr[1]).intValue()); - } - break; - case LPAREN: - args = Arguments(); - if (jj_2_41(2)) { - anonymousBody = ClassOrInterfaceBody(false); - } else { - ; - } - ret = new ObjectCreationExpr(line, column, token.endLine, token.endColumn, scope, (ClassOrInterfaceType) type, typeArgs, args, anonymousBody); - break; - default: - jj_la1[107] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - default: - jj_la1[108] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - -/* - * The third LOOKAHEAD specification below is to parse to PrimarySuffix - * if there is an expression between the "[...]". - */ - final public Object[] ArrayDimsAndInits() throws ParseException { - Object[] ret = new Object[2]; - Expression expr; - List inits = null; - int i = 0; - if (jj_2_44(2)) { - label_46: - while (true) { - jj_consume_token(LBRACKET); - expr = Expression(); - inits = add(inits, expr); - jj_consume_token(RBRACKET); - if (jj_2_42(2)) { - ; - } else { - break label_46; - } - } - label_47: - while (true) { - if (jj_2_43(2)) { - ; - } else { - break label_47; - } - jj_consume_token(LBRACKET); - jj_consume_token(RBRACKET); - i++; - } - ret[0] = inits; ret[1] = Integer.valueOf(i); - } else { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACKET: - label_48: - while (true) { - jj_consume_token(LBRACKET); - jj_consume_token(RBRACKET); - i++; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACKET: - ; - break; - default: - jj_la1[109] = jj_gen; - break label_48; - } - } - expr = ArrayInitializer(); - ret[0] = Integer.valueOf(i); ret[1] = expr; - break; - default: - jj_la1[110] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - -/* - * Statement syntax follows. - */ - final public Statement Statement() throws ParseException { - Statement ret; - if (jj_2_45(2)) { - ret = LabeledStatement(); - } else { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case ASSERT: - ret = AssertStatement(); - break; - case LBRACE: - ret = Block(); - break; - case SEMICOLON: - ret = EmptyStatement(); - break; - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case INCR: - case DECR: - ret = StatementExpression(); - break; - case SWITCH: - ret = SwitchStatement(); - break; - case IF: - ret = IfStatement(); - break; - case WHILE: - ret = WhileStatement(); - break; - case DO: - ret = DoStatement(); - break; - case FOR: - ret = ForStatement(); - break; - case BREAK: - ret = BreakStatement(); - break; - case CONTINUE: - ret = ContinueStatement(); - break; - case RETURN: - ret = ReturnStatement(); - break; - case THROW: - ret = ThrowStatement(); - break; - case SYNCHRONIZED: - ret = SynchronizedStatement(); - break; - case TRY: - ret = TryStatement(); - break; - default: - jj_la1[111] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public AssertStmt AssertStatement() throws ParseException { - Expression check; - Expression msg = null; - int line; - int column; - jj_consume_token(ASSERT); - line=token.beginLine; column=token.beginColumn; - check = Expression(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COLON: - jj_consume_token(COLON); - msg = Expression(); - break; - default: - jj_la1[112] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - {if (true) return new AssertStmt(line, column, token.endLine, token.endColumn,check, msg);} - throw new Error("Missing return statement in function"); - } - - final public LabeledStmt LabeledStatement() throws ParseException { - String label; - Statement stmt; - int line; - int column; - jj_consume_token(IDENTIFIER); - line=token.beginLine; column=token.beginColumn; - label = token.image; - jj_consume_token(COLON); - stmt = Statement(); - {if (true) return new LabeledStmt(line, column, token.endLine, token.endColumn,label, stmt);} - throw new Error("Missing return statement in function"); - } - - final public BlockStmt Block() throws ParseException { - List stmts; - int beginLine; - int beginColumn; - jj_consume_token(LBRACE); - beginLine=token.beginLine; beginColumn=token.beginColumn; - stmts = Statements(); - jj_consume_token(RBRACE); - {if (true) return new BlockStmt(beginLine, beginColumn, token.endLine, token.endColumn, stmts);} - throw new Error("Missing return statement in function"); - } - -/* - * Classes inside block stametents can only be abstract or final. The semantic must check it. - */ - final public Statement BlockStatement() throws ParseException { - Statement ret; - Expression expr; - ClassOrInterfaceDeclaration typeDecl; - Modifier modifier; - if (jj_2_46(2147483647)) { - pushJavadoc(); - modifier = Modifiers(); - typeDecl = ClassOrInterfaceDeclaration(modifier); - ret = new TypeDeclarationStmt(typeDecl.getBeginLine(), typeDecl.getBeginColumn(), token.endLine, token.endColumn, typeDecl); - } else if (jj_2_47(2147483647)) { - expr = VariableDeclarationExpression(); - jj_consume_token(SEMICOLON); - ret = new ExpressionStmt(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr); - } else { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case ASSERT: - case BOOLEAN: - case BREAK: - case BYTE: - case CHAR: - case CONTINUE: - case DO: - case DOUBLE: - case FALSE: - case FLOAT: - case FOR: - case IF: - case INT: - case LONG: - case NEW: - case NULL: - case RETURN: - case SHORT: - case SUPER: - case SWITCH: - case SYNCHRONIZED: - case THIS: - case THROW: - case TRUE: - case TRY: - case VOID: - case WHILE: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case LBRACE: - case SEMICOLON: - case INCR: - case DECR: - ret = Statement(); - break; - default: - jj_la1[113] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public VariableDeclarationExpr VariableDeclarationExpression() throws ParseException { - Modifier modifier; - Type type; - List vars = new LinkedList(); - VariableDeclarator var; - modifier = Modifiers(); - type = UnType(); - var = VariableDeclarator(); - vars.add(var); - label_49: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[114] = jj_gen; - break label_49; - } - jj_consume_token(COMMA); - var = VariableDeclarator(); - vars.add(var); - } - int line = modifier.beginLine; - int column = modifier.beginColumn; - if (line==-1) {line=type.getBeginLine(); column=type.getBeginColumn(); } - type.setAnnotations(modifier.annotations); - {if (true) return new VariableDeclarationExpr(line, column, token.endLine, token.endColumn, modifier.modifiers, null, type, vars);} - throw new Error("Missing return statement in function"); - } - - final public EmptyStmt EmptyStatement() throws ParseException { - jj_consume_token(SEMICOLON); - {if (true) return new EmptyStmt(token.beginLine, token.beginColumn, token.endLine, token.endColumn);} - throw new Error("Missing return statement in function"); - } - - final public ExpressionStmt StatementExpression() throws ParseException { - Expression expr; - AssignExpr.Operator op; - Expression value; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case INCR: - expr = PreIncrementExpression(); - break; - case DECR: - expr = PreDecrementExpression(); - break; - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - expr = PrimaryExpression(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case ASSIGN: - case INCR: - case DECR: - case PLUSASSIGN: - case MINUSASSIGN: - case STARASSIGN: - case SLASHASSIGN: - case ANDASSIGN: - case ORASSIGN: - case XORASSIGN: - case REMASSIGN: - case LSHIFTASSIGN: - case RSIGNEDSHIFTASSIGN: - case RUNSIGNEDSHIFTASSIGN: - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case INCR: - jj_consume_token(INCR); - expr = new UnaryExpr(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr, UnaryExpr.Operator.posIncrement); - break; - case DECR: - jj_consume_token(DECR); - expr = new UnaryExpr(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr, UnaryExpr.Operator.posDecrement); - break; - case ASSIGN: - case PLUSASSIGN: - case MINUSASSIGN: - case STARASSIGN: - case SLASHASSIGN: - case ANDASSIGN: - case ORASSIGN: - case XORASSIGN: - case REMASSIGN: - case LSHIFTASSIGN: - case RSIGNEDSHIFTASSIGN: - case RUNSIGNEDSHIFTASSIGN: - op = AssignmentOperator(); - value = Expression(); - expr = new AssignExpr(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr, value, op); - break; - default: - jj_la1[115] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - default: - jj_la1[116] = jj_gen; - ; - } - break; - default: - jj_la1[117] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - jj_consume_token(SEMICOLON); - {if (true) return new ExpressionStmt(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr);} - throw new Error("Missing return statement in function"); - } - - final public SwitchStmt SwitchStatement() throws ParseException { - Expression selector; - SwitchEntryStmt entry; - List entries = null; - int line; - int column; - jj_consume_token(SWITCH); - line=token.beginLine; column=token.beginColumn; - jj_consume_token(LPAREN); - selector = Expression(); - jj_consume_token(RPAREN); - jj_consume_token(LBRACE); - label_50: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case CASE: - case _DEFAULT: - ; - break; - default: - jj_la1[118] = jj_gen; - break label_50; - } - entry = SwitchEntry(); - entries = add(entries, entry); - } - jj_consume_token(RBRACE); - {if (true) return new SwitchStmt(line, column, token.endLine, token.endColumn,selector, entries);} - throw new Error("Missing return statement in function"); - } - - final public SwitchEntryStmt SwitchEntry() throws ParseException { - Expression label = null; - List stmts; - int line; - int column; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case CASE: - jj_consume_token(CASE); - line=token.beginLine; column=token.beginColumn; - label = Expression(); - break; - case _DEFAULT: - jj_consume_token(_DEFAULT); - line=token.beginLine; column=token.beginColumn; - break; - default: - jj_la1[119] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - jj_consume_token(COLON); - stmts = Statements(); - {if (true) return new SwitchEntryStmt(line, column, token.endLine, token.endColumn,label, stmts);} - throw new Error("Missing return statement in function"); - } - - final public IfStmt IfStatement() throws ParseException { - Expression condition; - Statement thenStmt; - Statement elseStmt = null; - int line; - int column; - jj_consume_token(IF); - line=token.beginLine; column=token.beginColumn; - jj_consume_token(LPAREN); - condition = Expression(); - jj_consume_token(RPAREN); - thenStmt = Statement(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case ELSE: - jj_consume_token(ELSE); - elseStmt = Statement(); - break; - default: - jj_la1[120] = jj_gen; - ; - } - {if (true) return new IfStmt(line, column, token.endLine, token.endColumn,condition, thenStmt, elseStmt);} - throw new Error("Missing return statement in function"); - } - - final public WhileStmt WhileStatement() throws ParseException { - Expression condition; - Statement body; - int line; - int column; - jj_consume_token(WHILE); - line=token.beginLine; column=token.beginColumn; - jj_consume_token(LPAREN); - condition = Expression(); - jj_consume_token(RPAREN); - body = Statement(); - {if (true) return new WhileStmt(line, column, token.endLine, token.endColumn,condition, body);} - throw new Error("Missing return statement in function"); - } - - final public DoStmt DoStatement() throws ParseException { - Expression condition; - Statement body; - int line; - int column; - jj_consume_token(DO); - line=token.beginLine; column=token.beginColumn; - body = Statement(); - jj_consume_token(WHILE); - jj_consume_token(LPAREN); - condition = Expression(); - jj_consume_token(RPAREN); - jj_consume_token(SEMICOLON); - {if (true) return new DoStmt(line, column, token.endLine, token.endColumn,body, condition);} - throw new Error("Missing return statement in function"); - } - - final public Statement ForStatement() throws ParseException { - String id = null; - VariableDeclarationExpr varExpr = null; - Expression expr = null; - List init = null; - List update = null; - Statement body; - int line; - int column; - jj_consume_token(FOR); - line=token.beginLine; column=token.beginColumn; - jj_consume_token(LPAREN); - if (jj_2_48(2147483647)) { - varExpr = VariableDeclarationExpression(); - jj_consume_token(COLON); - expr = Expression(); - } else { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FINAL: - case FLOAT: - case INT: - case LONG: - case NATIVE: - case NEW: - case NULL: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SUPER: - case SYNCHRONIZED: - case THIS: - case TRANSIENT: - case TRUE: - case VOID: - case VOLATILE: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case SEMICOLON: - case AT: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FINAL: - case FLOAT: - case INT: - case LONG: - case NATIVE: - case NEW: - case NULL: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SUPER: - case SYNCHRONIZED: - case THIS: - case TRANSIENT: - case TRUE: - case VOID: - case VOLATILE: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case AT: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - init = ForInit(); - break; - default: - jj_la1[121] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - expr = Expression(); - break; - default: - jj_la1[122] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - update = ForUpdate(); - break; - default: - jj_la1[123] = jj_gen; - ; - } - break; - default: - jj_la1[124] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - jj_consume_token(RPAREN); - body = Statement(); - if (varExpr != null) { - {if (true) return new ForeachStmt(line, column, token.endLine, token.endColumn,varExpr, expr, body);} - } - {if (true) return new ForStmt(line, column, token.endLine, token.endColumn,init, expr, update, body);} - throw new Error("Missing return statement in function"); - } - - final public List ForInit() throws ParseException { - List ret; - Expression expr; - if (jj_2_49(2147483647)) { - expr = VariableDeclarationExpression(); - ret = new LinkedList(); ret.add(expr); - } else { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - ret = ExpressionList(); - break; - default: - jj_la1[125] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public List ExpressionList() throws ParseException { - List ret = new LinkedList(); - Expression expr; - expr = Expression(); - ret.add(expr); - label_51: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[126] = jj_gen; - break label_51; - } - jj_consume_token(COMMA); - expr = Expression(); - ret.add(expr); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public List ForUpdate() throws ParseException { - List ret; - ret = ExpressionList(); - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public BreakStmt BreakStatement() throws ParseException { - String id = null; - int line; - int column; - jj_consume_token(BREAK); - line=token.beginLine; column=token.beginColumn; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IDENTIFIER: - jj_consume_token(IDENTIFIER); - id = token.image; - break; - default: - jj_la1[127] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - {if (true) return new BreakStmt(line, column, token.endLine, token.endColumn,id);} - throw new Error("Missing return statement in function"); - } - - final public ContinueStmt ContinueStatement() throws ParseException { - String id = null; - int line; - int column; - jj_consume_token(CONTINUE); - line=token.beginLine; column=token.beginColumn; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IDENTIFIER: - jj_consume_token(IDENTIFIER); - id = token.image; - break; - default: - jj_la1[128] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - {if (true) return new ContinueStmt(line, column, token.endLine, token.endColumn,id);} - throw new Error("Missing return statement in function"); - } - - final public ReturnStmt ReturnStatement() throws ParseException { - Expression expr = null; - int line; - int column; - jj_consume_token(RETURN); - line=token.beginLine; column=token.beginColumn; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - expr = Expression(); - break; - default: - jj_la1[129] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - {if (true) return new ReturnStmt(line, column, token.endLine, token.endColumn,expr);} - throw new Error("Missing return statement in function"); - } - - final public ThrowStmt ThrowStatement() throws ParseException { - Expression expr; - int line; - int column; - jj_consume_token(THROW); - line=token.beginLine; column=token.beginColumn; - expr = Expression(); - jj_consume_token(SEMICOLON); - {if (true) return new ThrowStmt(line, column, token.endLine, token.endColumn,expr);} - throw new Error("Missing return statement in function"); - } - - final public SynchronizedStmt SynchronizedStatement() throws ParseException { - Expression expr; - BlockStmt block; - int line; - int column; - jj_consume_token(SYNCHRONIZED); - line=token.beginLine; column=token.beginColumn; - jj_consume_token(LPAREN); - expr = Expression(); - jj_consume_token(RPAREN); - block = Block(); - {if (true) return new SynchronizedStmt(line, column, token.endLine, token.endColumn,expr, block);} - throw new Error("Missing return statement in function"); - } - - final public TryStmt TryStatement() throws ParseException { - BlockStmt tryBlock; - BlockStmt finallyBlock = null; - List catchs = null; - Parameter except; - BlockStmt catchBlock; - int line; - int column; - int cLine; - int cColumn; - jj_consume_token(TRY); - line=token.beginLine; column=token.beginColumn; - tryBlock = Block(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case CATCH: - label_52: - while (true) { - jj_consume_token(CATCH); - cLine=token.beginLine; cColumn=token.beginColumn; - jj_consume_token(LPAREN); - except = FormalParameter(); - jj_consume_token(RPAREN); - catchBlock = Block(); - catchs = add(catchs, new CatchClause(cLine, cColumn, token.endLine, token.endColumn, except, catchBlock)); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case CATCH: - ; - break; - default: - jj_la1[130] = jj_gen; - break label_52; - } - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case FINALLY: - jj_consume_token(FINALLY); - finallyBlock = Block(); - break; - default: - jj_la1[131] = jj_gen; - ; - } - break; - case FINALLY: - jj_consume_token(FINALLY); - finallyBlock = Block(); - break; - default: - jj_la1[132] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - {if (true) return new TryStmt(line, column, token.endLine, token.endColumn,tryBlock, catchs, finallyBlock);} - throw new Error("Missing return statement in function"); - } - -/* We use productions to match >>>, >> and > so that we can keep the - * type declaration syntax with generics clean - */ - final public void RUNSIGNEDSHIFT() throws ParseException { - if (getToken(1).kind == GT && - ((GTToken)getToken(1)).realKind == RUNSIGNEDSHIFT) { - - } else { - jj_consume_token(-1); - throw new ParseException(); - } - jj_consume_token(GT); - jj_consume_token(GT); - jj_consume_token(GT); - } - - final public void RSIGNEDSHIFT() throws ParseException { - if (getToken(1).kind == GT && - ((GTToken)getToken(1)).realKind == RSIGNEDSHIFT) { - - } else { - jj_consume_token(-1); - throw new ParseException(); - } - jj_consume_token(GT); - jj_consume_token(GT); - } - -/* Annotation syntax follows. */ - final public List Annotationsopt() throws ParseException { - List annotations = new LinkedList(); - AnnotationExpr ann; - label_53: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case AT: - ; - break; - default: - jj_la1[133] = jj_gen; - break label_53; - } - ann = Annotation(); - annotations.add(ann); - } - {if (true) return annotations;} - throw new Error("Missing return statement in function"); - } - - final public AnnotationExpr Annotation() throws ParseException { - AnnotationExpr ret; - if (jj_2_50(2147483647)) { - ret = NormalAnnotation(); - } else if (jj_2_51(2147483647)) { - ret = SingleMemberAnnotation(); - } else { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case AT: - ret = MarkerAnnotation(); - break; - default: - jj_la1[134] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public NormalAnnotationExpr NormalAnnotation() throws ParseException { - NameExpr name; - List pairs = null; - int line; - int column; - jj_consume_token(AT); - line=token.beginLine; column=token.beginColumn; - name = Name(); - jj_consume_token(LPAREN); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IDENTIFIER: - pairs = MemberValuePairs(); - break; - default: - jj_la1[135] = jj_gen; - ; - } - jj_consume_token(RPAREN); - {if (true) return new NormalAnnotationExpr(line, column, token.endLine, token.endColumn,name, pairs);} - throw new Error("Missing return statement in function"); - } - - final public MarkerAnnotationExpr MarkerAnnotation() throws ParseException { - NameExpr name; - int line; - int column; - jj_consume_token(AT); - line=token.beginLine; column=token.beginColumn; - name = Name(); - {if (true) return new MarkerAnnotationExpr(line, column, token.endLine, token.endColumn,name);} - throw new Error("Missing return statement in function"); - } - - final public SingleMemberAnnotationExpr SingleMemberAnnotation() throws ParseException { - NameExpr name; - Expression memberVal; - int line; - int column; - jj_consume_token(AT); - line=token.beginLine; column=token.beginColumn; - name = Name(); - jj_consume_token(LPAREN); - memberVal = MemberValue(); - jj_consume_token(RPAREN); - {if (true) return new SingleMemberAnnotationExpr(line, column, token.endLine, token.endColumn,name, memberVal);} - throw new Error("Missing return statement in function"); - } - - final public List MemberValuePairs() throws ParseException { - List ret = new LinkedList(); - MemberValuePair pair; - pair = MemberValuePair(); - ret.add(pair); - label_54: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[136] = jj_gen; - break label_54; - } - jj_consume_token(COMMA); - pair = MemberValuePair(); - ret.add(pair); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public MemberValuePair MemberValuePair() throws ParseException { - String name; - Expression value; - int line; - int column; - jj_consume_token(IDENTIFIER); - name = token.image; line=token.beginLine; column=token.beginColumn; - jj_consume_token(ASSIGN); - value = MemberValue(); - {if (true) return new MemberValuePair(line, column, token.endLine, token.endColumn,name, value);} - throw new Error("Missing return statement in function"); - } - - final public Expression MemberValue() throws ParseException { - Expression ret; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case AT: - ret = Annotation(); - break; - case LBRACE: - ret = MemberValueArrayInitializer(); - break; - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - ret = ConditionalExpression(); - break; - default: - jj_la1[137] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public Expression MemberValueArrayInitializer() throws ParseException { - List ret = new LinkedList(); - Expression member; - int line; - int column; - jj_consume_token(LBRACE); - line=token.beginLine; column=token.beginColumn; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case LBRACE: - case AT: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - member = MemberValue(); - ret.add(member); - label_55: - while (true) { - if (jj_2_52(2)) { - ; - } else { - break label_55; - } - jj_consume_token(COMMA); - member = MemberValue(); - ret.add(member); - } - break; - default: - jj_la1[138] = jj_gen; - ; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COMMA: - jj_consume_token(COMMA); - break; - default: - jj_la1[139] = jj_gen; - ; - } - jj_consume_token(RBRACE); - {if (true) return new ArrayInitializerExpr(line, column, token.endLine, token.endColumn,ret);} - throw new Error("Missing return statement in function"); - } - -/* Annotation Types. */ - final public AnnotationDeclaration AnnotationTypeDeclaration(Modifier modifier) throws ParseException { - String name; - List members; - int line = modifier.beginLine; - int column = modifier.beginColumn; - jj_consume_token(AT); - if (line == -1) {line=token.beginLine; column=token.beginColumn;} - jj_consume_token(INTERFACE); - jj_consume_token(IDENTIFIER); - name = token.image; - members = AnnotationTypeBody(); - {if (true) return new AnnotationDeclaration(line, column, token.endLine, token.endColumn,popJavadoc(), modifier.modifiers, modifier.annotations, name, members);} - throw new Error("Missing return statement in function"); - } - - final public List AnnotationTypeBody() throws ParseException { - List ret = null; - BodyDeclaration member; - jj_consume_token(LBRACE); - label_56: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case CLASS: - case DOUBLE: - case ENUM: - case FINAL: - case FLOAT: - case INT: - case INTERFACE: - case LONG: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOLATILE: - case IDENTIFIER: - case SEMICOLON: - case AT: - ; - break; - default: - jj_la1[140] = jj_gen; - break label_56; - } - member = AnnotationBodyDeclaration(); - ret = add(ret, member); - } - jj_consume_token(RBRACE); - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public BodyDeclaration AnnotationBodyDeclaration() throws ParseException { - Modifier modifier; - BodyDeclaration ret; - pushJavadoc(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case SEMICOLON: - jj_consume_token(SEMICOLON); - ret = new EmptyTypeDeclaration(token.beginLine, token.beginColumn, token.endLine, token.endColumn, popJavadoc()); - break; - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case CLASS: - case DOUBLE: - case ENUM: - case FINAL: - case FLOAT: - case INT: - case INTERFACE: - case LONG: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOLATILE: - case IDENTIFIER: - case AT: - modifier = Modifiers(); - if (jj_2_53(2147483647)) { - ret = AnnotationTypeMemberDeclaration(modifier); - } else { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case CLASS: - case INTERFACE: - ret = ClassOrInterfaceDeclaration(modifier); - break; - case ENUM: - ret = EnumDeclaration(modifier); - break; - case AT: - ret = AnnotationTypeDeclaration(modifier); - break; - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - case IDENTIFIER: - ret = FieldDeclaration(modifier); - break; - default: - jj_la1[141] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - break; - default: - jj_la1[142] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - final public AnnotationMemberDeclaration AnnotationTypeMemberDeclaration(Modifier modifier) throws ParseException { - Type type; - String name; - Expression defaultVal = null; - type = Type(); - jj_consume_token(IDENTIFIER); - name = token.image; - jj_consume_token(LPAREN); - jj_consume_token(RPAREN); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case _DEFAULT: - defaultVal = DefaultValue(); - break; - default: - jj_la1[143] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - int line = modifier.beginLine; - int column = modifier.beginColumn; - { if (line == -1) {line=type.getBeginLine(); column=type.getBeginColumn();} } - {if (true) return new AnnotationMemberDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), modifier.modifiers, modifier.annotations, type, name, defaultVal);} - throw new Error("Missing return statement in function"); - } - - final public Expression DefaultValue() throws ParseException { - Expression ret; - jj_consume_token(_DEFAULT); - ret = MemberValue(); - {if (true) return ret;} - throw new Error("Missing return statement in function"); - } - - private boolean jj_2_1(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_1(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(0, xla); } - } - - private boolean jj_2_2(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_2(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(1, xla); } - } - - private boolean jj_2_3(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_3(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(2, xla); } - } - - private boolean jj_2_4(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_4(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(3, xla); } - } - - private boolean jj_2_5(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_5(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(4, xla); } - } - - private boolean jj_2_6(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_6(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(5, xla); } - } - - private boolean jj_2_7(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_7(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(6, xla); } - } - - private boolean jj_2_8(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_8(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(7, xla); } - } - - private boolean jj_2_9(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_9(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(8, xla); } - } - - private boolean jj_2_10(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_10(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(9, xla); } - } - - private boolean jj_2_11(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_11(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(10, xla); } - } - - private boolean jj_2_12(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_12(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(11, xla); } - } - - private boolean jj_2_13(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_13(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(12, xla); } - } - - private boolean jj_2_14(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_14(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(13, xla); } - } - - private boolean jj_2_15(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_15(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(14, xla); } - } - - private boolean jj_2_16(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_16(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(15, xla); } - } - - private boolean jj_2_17(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_17(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(16, xla); } - } - - private boolean jj_2_18(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_18(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(17, xla); } - } - - private boolean jj_2_19(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_19(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(18, xla); } - } - - private boolean jj_2_20(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_20(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(19, xla); } - } - - private boolean jj_2_21(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_21(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(20, xla); } - } - - private boolean jj_2_22(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_22(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(21, xla); } - } - - private boolean jj_2_23(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_23(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(22, xla); } - } - - private boolean jj_2_24(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_24(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(23, xla); } - } - - private boolean jj_2_25(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_25(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(24, xla); } - } - - private boolean jj_2_26(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_26(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(25, xla); } - } - - private boolean jj_2_27(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_27(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(26, xla); } - } - - private boolean jj_2_28(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_28(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(27, xla); } - } - - private boolean jj_2_29(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_29(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(28, xla); } - } - - private boolean jj_2_30(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_30(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(29, xla); } - } - - private boolean jj_2_31(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_31(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(30, xla); } - } - - private boolean jj_2_32(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_32(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(31, xla); } - } - - private boolean jj_2_33(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_33(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(32, xla); } - } - - private boolean jj_2_34(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_34(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(33, xla); } - } - - private boolean jj_2_35(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_35(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(34, xla); } - } - - private boolean jj_2_36(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_36(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(35, xla); } - } - - private boolean jj_2_37(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_37(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(36, xla); } - } - - private boolean jj_2_38(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_38(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(37, xla); } - } - - private boolean jj_2_39(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_39(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(38, xla); } - } - - private boolean jj_2_40(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_40(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(39, xla); } - } - - private boolean jj_2_41(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_41(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(40, xla); } - } - - private boolean jj_2_42(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_42(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(41, xla); } - } - - private boolean jj_2_43(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_43(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(42, xla); } - } - - private boolean jj_2_44(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_44(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(43, xla); } - } - - private boolean jj_2_45(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_45(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(44, xla); } - } - - private boolean jj_2_46(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_46(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(45, xla); } - } - - private boolean jj_2_47(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_47(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(46, xla); } - } - - private boolean jj_2_48(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_48(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(47, xla); } - } - - private boolean jj_2_49(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_49(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(48, xla); } - } - - private boolean jj_2_50(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_50(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(49, xla); } - } - - private boolean jj_2_51(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_51(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(50, xla); } - } - - private boolean jj_2_52(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_52(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(51, xla); } - } - - private boolean jj_2_53(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_53(); } - catch (LookaheadSuccess ls) { return true; } - finally { jj_save(52, xla); } - } - - private boolean jj_3R_265() { - if (jj_3R_292()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3_34()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_231() { - if (jj_3R_89()) return true; - return false; - } - - private boolean jj_3R_232() { - if (jj_3R_265()) return true; - return false; - } - - private boolean jj_3R_264() { - if (jj_scan_token(BANG)) return true; - return false; - } - - private boolean jj_3R_263() { - if (jj_scan_token(TILDE)) return true; - return false; - } - - private boolean jj_3R_367() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_156()) return true; - return false; - } - - private boolean jj_3_9() { - if (jj_3R_73()) return true; - if (jj_scan_token(IDENTIFIER)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_74()) { jj_scanpos = xsp; break; } - } - xsp = jj_scanpos; - if (jj_scan_token(87)) { - jj_scanpos = xsp; - if (jj_scan_token(90)) { - jj_scanpos = xsp; - if (jj_scan_token(86)) return true; - } - } - return false; - } - - private boolean jj_3R_230() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_263()) { - jj_scanpos = xsp; - if (jj_3R_264()) return true; - } - if (jj_3R_193()) return true; - return false; - } - - private boolean jj_3R_206() { - if (jj_scan_token(AT)) return true; - if (jj_3R_101()) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_103()) return true; - if (jj_scan_token(RPAREN)) return true; - return false; - } - - private boolean jj_3R_72() { - if (jj_3R_110()) return true; - return false; - } - - private boolean jj_3_8() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_72()) jj_scanpos = xsp; - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_scan_token(LPAREN)) return true; - return false; - } - - private boolean jj_3R_295() { - if (jj_3R_73()) return true; - if (jj_3R_156()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_367()) { jj_scanpos = xsp; break; } - } - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_102() { - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_scan_token(ASSIGN)) return true; - return false; - } - - private boolean jj_3R_272() { - if (jj_3R_296()) return true; - return false; - } - - private boolean jj_3R_236() { - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_194() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_230()) { - jj_scanpos = xsp; - if (jj_3R_231()) { - jj_scanpos = xsp; - if (jj_3R_232()) return true; - } - } - return false; - } - - private boolean jj_3R_271() { - if (jj_3R_295()) return true; - return false; - } - - private boolean jj_3R_207() { - if (jj_scan_token(AT)) return true; - if (jj_3R_101()) return true; - return false; - } - - private boolean jj_3R_270() { - if (jj_3R_294()) return true; - return false; - } - - private boolean jj_3R_269() { - if (jj_3R_204()) return true; - return false; - } - - private boolean jj_3R_268() { - if (jj_3R_203()) return true; - return false; - } - - private boolean jj_3_51() { - if (jj_scan_token(AT)) return true; - if (jj_3R_101()) return true; - if (jj_scan_token(LPAREN)) return true; - return false; - } - - private boolean jj_3R_267() { - if (jj_3R_202()) return true; - return false; - } - - private boolean jj_3R_260() { - if (jj_scan_token(DECR)) return true; - if (jj_3R_193()) return true; - return false; - } - - private boolean jj_3_50() { - if (jj_scan_token(AT)) return true; - if (jj_3R_101()) return true; - if (jj_scan_token(LPAREN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_102()) { - jj_scanpos = xsp; - if (jj_scan_token(81)) return true; - } - return false; - } - - private boolean jj_3R_205() { - if (jj_scan_token(AT)) return true; - if (jj_3R_101()) return true; - if (jj_scan_token(LPAREN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_273()) jj_scanpos = xsp; - if (jj_scan_token(RPAREN)) return true; - return false; - } - - private boolean jj_3R_235() { - if (jj_3R_99()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_267()) { - jj_scanpos = xsp; - if (jj_3R_268()) { - jj_scanpos = xsp; - if (jj_3R_269()) { - jj_scanpos = xsp; - if (jj_3R_270()) { - jj_scanpos = xsp; - if (jj_3R_271()) { - jj_scanpos = xsp; - if (jj_3R_272()) return true; - } - } - } - } - } - return false; - } - - private boolean jj_3R_167() { - if (jj_3R_207()) return true; - return false; - } - - private boolean jj_3R_166() { - if (jj_3R_206()) return true; - return false; - } - - private boolean jj_3R_259() { - if (jj_scan_token(INCR)) return true; - if (jj_3R_193()) return true; - return false; - } - - private boolean jj_3R_165() { - if (jj_3R_205()) return true; - return false; - } - - private boolean jj_3_10() { - if (jj_3R_75()) return true; - return false; - } - - private boolean jj_3R_229() { - if (jj_3R_194()) return true; - return false; - } - - private boolean jj_3R_108() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_165()) { - jj_scanpos = xsp; - if (jj_3R_166()) { - jj_scanpos = xsp; - if (jj_3R_167()) return true; - } - } - return false; - } - - private boolean jj_3R_198() { - Token xsp; - xsp = jj_scanpos; - if (jj_3_10()) { - jj_scanpos = xsp; - if (jj_3R_235()) { - jj_scanpos = xsp; - if (jj_3R_236()) return true; - } - } - return false; - } - - private boolean jj_3R_116() { - if (jj_3R_108()) return true; - return false; - } - - private boolean jj_3R_155() { - if (jj_3R_198()) return true; - return false; - } - - private boolean jj_3R_262() { - if (jj_scan_token(MINUS)) return true; - return false; - } - - private boolean jj_3R_261() { - if (jj_scan_token(PLUS)) return true; - return false; - } - - private boolean jj_3R_228() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_261()) { - jj_scanpos = xsp; - if (jj_3R_262()) return true; - } - if (jj_3R_193()) return true; - return false; - } - - private boolean jj_3R_77() { - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_116()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_97() { - if (jj_scan_token(LBRACE)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_155()) { jj_scanpos = xsp; break; } - } - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_227() { - if (jj_3R_260()) return true; - return false; - } - - private boolean jj_3R_139() { - return false; - } - - private boolean jj_3R_226() { - if (jj_3R_259()) return true; - return false; - } - - private boolean jj_3_7() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_71()) return true; - return false; - } - - private boolean jj_3R_279() { - if (jj_scan_token(BIT_AND)) return true; - if (jj_3R_278()) return true; - return false; - } - - private boolean jj_3R_246() { - if (jj_scan_token(EXTENDS)) return true; - if (jj_3R_278()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_279()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_140() { - return false; - } - - private boolean jj_3R_193() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_226()) { - jj_scanpos = xsp; - if (jj_3R_227()) { - jj_scanpos = xsp; - if (jj_3R_228()) { - jj_scanpos = xsp; - if (jj_3R_229()) return true; - } - } - } - return false; - } - - private boolean jj_3R_87() { - jj_lookingAhead = true; - jj_semLA = getToken(1).kind == GT && - ((GTToken)getToken(1)).realKind == RSIGNEDSHIFT; - jj_lookingAhead = false; - if (!jj_semLA || jj_3R_139()) return true; - if (jj_scan_token(GT)) return true; - if (jj_scan_token(GT)) return true; - return false; - } - - private boolean jj_3R_398() { - if (jj_scan_token(REM)) return true; - return false; - } - - private boolean jj_3R_397() { - if (jj_scan_token(SLASH)) return true; - return false; - } - - private boolean jj_3R_396() { - if (jj_scan_token(STAR)) return true; - return false; - } - - private boolean jj_3R_414() { - if (jj_scan_token(CATCH)) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_382()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_113()) return true; - return false; - } - - private boolean jj_3R_168() { - if (jj_3R_77()) return true; - if (jj_scan_token(IDENTIFIER)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_208()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_393() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_396()) { - jj_scanpos = xsp; - if (jj_3R_397()) { - jj_scanpos = xsp; - if (jj_3R_398()) return true; - } - } - if (jj_3R_193()) return true; - return false; - } - - private boolean jj_3R_301() { - if (jj_3R_97()) return true; - return false; - } - - private boolean jj_3R_415() { - if (jj_scan_token(FINALLY)) return true; - if (jj_3R_113()) return true; - return false; - } - - private boolean jj_3R_408() { - if (jj_scan_token(FINALLY)) return true; - if (jj_3R_113()) return true; - return false; - } - - private boolean jj_3R_88() { - jj_lookingAhead = true; - jj_semLA = getToken(1).kind == GT && - ((GTToken)getToken(1)).realKind == RUNSIGNEDSHIFT; - jj_lookingAhead = false; - if (!jj_semLA || jj_3R_140()) return true; - if (jj_scan_token(GT)) return true; - if (jj_scan_token(GT)) return true; - if (jj_scan_token(GT)) return true; - return false; - } - - private boolean jj_3R_406() { - if (jj_3R_85()) return true; - return false; - } - - private boolean jj_3R_407() { - Token xsp; - if (jj_3R_414()) return true; - while (true) { - xsp = jj_scanpos; - if (jj_3R_414()) { jj_scanpos = xsp; break; } - } - xsp = jj_scanpos; - if (jj_3R_415()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_385() { - if (jj_3R_193()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_393()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_169() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_168()) return true; - return false; - } - - private boolean jj_3R_395() { - if (jj_scan_token(MINUS)) return true; - return false; - } - - private boolean jj_3R_394() { - if (jj_scan_token(PLUS)) return true; - return false; - } - - private boolean jj_3R_110() { - if (jj_scan_token(LT)) return true; - if (jj_3R_168()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_169()) { jj_scanpos = xsp; break; } - } - if (jj_scan_token(GT)) return true; - return false; - } - - private boolean jj_3R_405() { - if (jj_scan_token(IDENTIFIER)) return true; - return false; - } - - private boolean jj_3R_392() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_394()) { - jj_scanpos = xsp; - if (jj_3R_395()) return true; - } - if (jj_3R_385()) return true; - return false; - } - - private boolean jj_3R_300() { - if (jj_3R_174()) return true; - return false; - } - - private boolean jj_3R_378() { - if (jj_3R_385()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_392()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_355() { - if (jj_scan_token(TRY)) return true; - if (jj_3R_113()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_407()) { - jj_scanpos = xsp; - if (jj_3R_408()) return true; - } - return false; - } - - private boolean jj_3R_109() { - if (jj_3R_108()) return true; - return false; - } - - private boolean jj_3R_276() { - if (jj_3R_198()) return true; - return false; - } - - private boolean jj_3R_71() { - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_109()) { jj_scanpos = xsp; break; } - } - if (jj_scan_token(IDENTIFIER)) return true; - xsp = jj_scanpos; - if (jj_3R_300()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_301()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3_32() { - if (jj_3R_88()) return true; - return false; - } - - private boolean jj_3R_404() { - if (jj_scan_token(IDENTIFIER)) return true; - return false; - } - - private boolean jj_3_31() { - if (jj_3R_87()) return true; - return false; - } - - private boolean jj_3R_86() { - if (jj_scan_token(LSHIFT)) return true; - return false; - } - - private boolean jj_3R_244() { - if (jj_scan_token(SEMICOLON)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_276()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3_30() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_86()) { - jj_scanpos = xsp; - if (jj_3_31()) { - jj_scanpos = xsp; - if (jj_3_32()) return true; - } - } - if (jj_3R_378()) return true; - return false; - } - - private boolean jj_3R_379() { - if (jj_scan_token(INSTANCEOF)) return true; - if (jj_3R_104()) return true; - return false; - } - - private boolean jj_3R_372() { - if (jj_3R_378()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_30()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_354() { - if (jj_scan_token(SYNCHRONIZED)) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_85()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_113()) return true; - return false; - } - - private boolean jj_3R_391() { - if (jj_scan_token(GE)) return true; - return false; - } - - private boolean jj_3R_243() { - if (jj_3R_71()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_7()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_390() { - if (jj_scan_token(LE)) return true; - return false; - } - - private boolean jj_3R_389() { - if (jj_scan_token(GT)) return true; - return false; - } - - private boolean jj_3R_388() { - if (jj_scan_token(LT)) return true; - return false; - } - - private boolean jj_3R_386() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_388()) { - jj_scanpos = xsp; - if (jj_3R_389()) { - jj_scanpos = xsp; - if (jj_3R_390()) { - jj_scanpos = xsp; - if (jj_3R_391()) return true; - } - } - } - if (jj_3R_372()) return true; - return false; - } - - private boolean jj_3R_242() { - if (jj_3R_275()) return true; - return false; - } - - private boolean jj_3R_353() { - if (jj_scan_token(THROW)) return true; - if (jj_3R_85()) return true; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_203() { - if (jj_scan_token(ENUM)) return true; - if (jj_scan_token(IDENTIFIER)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_242()) jj_scanpos = xsp; - if (jj_scan_token(LBRACE)) return true; - xsp = jj_scanpos; - if (jj_3R_243()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_scan_token(87)) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_244()) jj_scanpos = xsp; - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_362() { - if (jj_3R_372()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_386()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_363() { - if (jj_scan_token(BIT_AND)) return true; - if (jj_3R_334()) return true; - return false; - } - - private boolean jj_3R_352() { - if (jj_scan_token(RETURN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_406()) jj_scanpos = xsp; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_356() { - if (jj_3R_362()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_379()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_426() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_85()) return true; - return false; - } - - private boolean jj_3R_299() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_278()) return true; - return false; - } - - private boolean jj_3R_275() { - if (jj_scan_token(IMPLEMENTS)) return true; - if (jj_3R_278()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_299()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_381() { - if (jj_scan_token(NE)) return true; - return false; - } - - private boolean jj_3R_401() { - if (jj_scan_token(ELSE)) return true; - if (jj_3R_303()) return true; - return false; - } - - private boolean jj_3R_380() { - if (jj_scan_token(EQ)) return true; - return false; - } - - private boolean jj_3R_351() { - if (jj_scan_token(CONTINUE)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_405()) jj_scanpos = xsp; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_373() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_380()) { - jj_scanpos = xsp; - if (jj_3R_381()) return true; - } - if (jj_3R_356()) return true; - return false; - } - - private boolean jj_3R_357() { - if (jj_scan_token(XOR)) return true; - if (jj_3R_309()) return true; - return false; - } - - private boolean jj_3R_335() { - if (jj_scan_token(BIT_OR)) return true; - if (jj_3R_291()) return true; - return false; - } - - private boolean jj_3R_334() { - if (jj_3R_356()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_373()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_413() { - if (jj_3R_422()) return true; - return false; - } - - private boolean jj_3R_298() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_278()) return true; - return false; - } - - private boolean jj_3R_350() { - if (jj_scan_token(BREAK)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_404()) jj_scanpos = xsp; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_274() { - if (jj_scan_token(EXTENDS)) return true; - if (jj_3R_278()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_298()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_310() { - if (jj_scan_token(SC_AND)) return true; - if (jj_3R_258()) return true; - return false; - } - - private boolean jj_3R_309() { - if (jj_3R_334()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_363()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_238() { - if (jj_scan_token(INTERFACE)) return true; - return false; - } - - private boolean jj_3R_293() { - if (jj_scan_token(SC_OR)) return true; - if (jj_3R_225()) return true; - return false; - } - - private boolean jj_3R_422() { - if (jj_3R_425()) return true; - return false; - } - - private boolean jj_3R_241() { - if (jj_3R_275()) return true; - return false; - } - - private boolean jj_3R_240() { - if (jj_3R_274()) return true; - return false; - } - - private boolean jj_3R_291() { - if (jj_3R_309()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_357()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_239() { - if (jj_3R_110()) return true; - return false; - } - - private boolean jj_3_49() { - if (jj_3R_99()) return true; - if (jj_3R_73()) return true; - if (jj_scan_token(IDENTIFIER)) return true; - return false; - } - - private boolean jj_3R_202() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(20)) { - jj_scanpos = xsp; - if (jj_3R_238()) return true; - } - if (jj_scan_token(IDENTIFIER)) return true; - xsp = jj_scanpos; - if (jj_3R_239()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_240()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_241()) jj_scanpos = xsp; - if (jj_3R_97()) return true; - return false; - } - - private boolean jj_3R_425() { - if (jj_3R_85()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_426()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_424() { - if (jj_3R_425()) return true; - return false; - } - - private boolean jj_3R_412() { - if (jj_3R_85()) return true; - return false; - } - - private boolean jj_3R_258() { - if (jj_3R_291()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_335()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_423() { - if (jj_3R_100()) return true; - return false; - } - - private boolean jj_3R_164() { - if (jj_3R_204()) return true; - return false; - } - - private boolean jj_3R_163() { - if (jj_3R_203()) return true; - return false; - } - - private boolean jj_3R_225() { - if (jj_3R_258()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_310()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_421() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_423()) { - jj_scanpos = xsp; - if (jj_3R_424()) return true; - } - return false; - } - - private boolean jj_3R_162() { - if (jj_3R_202()) return true; - return false; - } - - private boolean jj_3R_107() { - if (jj_3R_99()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_162()) { - jj_scanpos = xsp; - if (jj_3R_163()) { - jj_scanpos = xsp; - if (jj_3R_164()) return true; - } - } - return false; - } - - private boolean jj_3R_106() { - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3_48() { - if (jj_3R_100()) return true; - if (jj_scan_token(COLON)) return true; - return false; - } - - private boolean jj_3R_192() { - if (jj_3R_225()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_293()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_58() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_106()) { - jj_scanpos = xsp; - if (jj_3R_107()) return true; - } - return false; - } - - private boolean jj_3R_411() { - if (jj_3R_421()) return true; - return false; - } - - private boolean jj_3R_403() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_411()) jj_scanpos = xsp; - if (jj_scan_token(SEMICOLON)) return true; - xsp = jj_scanpos; - if (jj_3R_412()) jj_scanpos = xsp; - if (jj_scan_token(SEMICOLON)) return true; - xsp = jj_scanpos; - if (jj_3R_413()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_266() { - if (jj_scan_token(HOOK)) return true; - if (jj_3R_85()) return true; - if (jj_scan_token(COLON)) return true; - if (jj_3R_138()) return true; - return false; - } - - private boolean jj_3R_402() { - if (jj_3R_100()) return true; - if (jj_scan_token(COLON)) return true; - if (jj_3R_85()) return true; - return false; - } - - private boolean jj_3R_138() { - if (jj_3R_192()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_266()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_349() { - if (jj_scan_token(FOR)) return true; - if (jj_scan_token(LPAREN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_402()) { - jj_scanpos = xsp; - if (jj_3R_403()) return true; - } - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_303()) return true; - return false; - } - - private boolean jj_3R_137() { - if (jj_scan_token(ORASSIGN)) return true; - return false; - } - - private boolean jj_3R_70() { - if (jj_3R_108()) return true; - return false; - } - - private boolean jj_3R_136() { - if (jj_scan_token(XORASSIGN)) return true; - return false; - } - - private boolean jj_3R_135() { - if (jj_scan_token(ANDASSIGN)) return true; - return false; - } - - private boolean jj_3R_69() { - if (jj_scan_token(STRICTFP)) return true; - return false; - } - - private boolean jj_3R_134() { - if (jj_scan_token(RUNSIGNEDSHIFTASSIGN)) return true; - return false; - } - - private boolean jj_3R_133() { - if (jj_scan_token(RSIGNEDSHIFTASSIGN)) return true; - return false; - } - - private boolean jj_3R_68() { - if (jj_scan_token(VOLATILE)) return true; - return false; - } - - private boolean jj_3R_132() { - if (jj_scan_token(LSHIFTASSIGN)) return true; - return false; - } - - private boolean jj_3R_131() { - if (jj_scan_token(MINUSASSIGN)) return true; - return false; - } - - private boolean jj_3R_67() { - if (jj_scan_token(TRANSIENT)) return true; - return false; - } - - private boolean jj_3R_130() { - if (jj_scan_token(PLUSASSIGN)) return true; - return false; - } - - private boolean jj_3R_129() { - if (jj_scan_token(REMASSIGN)) return true; - return false; - } - - private boolean jj_3R_66() { - if (jj_scan_token(NATIVE)) return true; - return false; - } - - private boolean jj_3R_128() { - if (jj_scan_token(SLASHASSIGN)) return true; - return false; - } - - private boolean jj_3R_127() { - if (jj_scan_token(STARASSIGN)) return true; - return false; - } - - private boolean jj_3R_65() { - if (jj_scan_token(SYNCHRONIZED)) return true; - return false; - } - - private boolean jj_3R_126() { - if (jj_scan_token(ASSIGN)) return true; - return false; - } - - private boolean jj_3R_348() { - if (jj_scan_token(DO)) return true; - if (jj_3R_303()) return true; - if (jj_scan_token(WHILE)) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_85()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_64() { - if (jj_scan_token(ABSTRACT)) return true; - return false; - } - - private boolean jj_3R_63() { - if (jj_scan_token(FINAL)) return true; - return false; - } - - private boolean jj_3R_84() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_126()) { - jj_scanpos = xsp; - if (jj_3R_127()) { - jj_scanpos = xsp; - if (jj_3R_128()) { - jj_scanpos = xsp; - if (jj_3R_129()) { - jj_scanpos = xsp; - if (jj_3R_130()) { - jj_scanpos = xsp; - if (jj_3R_131()) { - jj_scanpos = xsp; - if (jj_3R_132()) { - jj_scanpos = xsp; - if (jj_3R_133()) { - jj_scanpos = xsp; - if (jj_3R_134()) { - jj_scanpos = xsp; - if (jj_3R_135()) { - jj_scanpos = xsp; - if (jj_3R_136()) { - jj_scanpos = xsp; - if (jj_3R_137()) return true; - } - } - } - } - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_62() { - if (jj_scan_token(PRIVATE)) return true; - return false; - } - - private boolean jj_3R_384() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_101()) return true; - return false; - } - - private boolean jj_3R_61() { - if (jj_scan_token(PROTECTED)) return true; - return false; - } - - private boolean jj_3R_60() { - if (jj_scan_token(STATIC)) return true; - return false; - } - - private boolean jj_3R_59() { - if (jj_scan_token(PUBLIC)) return true; - return false; - } - - private boolean jj_3R_347() { - if (jj_scan_token(WHILE)) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_85()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_303()) return true; - return false; - } - - private boolean jj_3_29() { - if (jj_3R_84()) return true; - if (jj_3R_85()) return true; - return false; - } - - private boolean jj_3_6() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_59()) { - jj_scanpos = xsp; - if (jj_3R_60()) { - jj_scanpos = xsp; - if (jj_3R_61()) { - jj_scanpos = xsp; - if (jj_3R_62()) { - jj_scanpos = xsp; - if (jj_3R_63()) { - jj_scanpos = xsp; - if (jj_3R_64()) { - jj_scanpos = xsp; - if (jj_3R_65()) { - jj_scanpos = xsp; - if (jj_3R_66()) { - jj_scanpos = xsp; - if (jj_3R_67()) { - jj_scanpos = xsp; - if (jj_3R_68()) { - jj_scanpos = xsp; - if (jj_3R_69()) { - jj_scanpos = xsp; - if (jj_3R_70()) return true; - } - } - } - } - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_99() { - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_6()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_85() { - if (jj_3R_138()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3_29()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_346() { - if (jj_scan_token(IF)) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_85()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_303()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_401()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_157() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_156()) return true; - return false; - } - - private boolean jj_3R_420() { - if (jj_scan_token(_DEFAULT)) return true; - return false; - } - - private boolean jj_3R_419() { - if (jj_scan_token(CASE)) return true; - if (jj_3R_85()) return true; - return false; - } - - private boolean jj_3R_375() { - if (jj_3R_101()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_384()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_105() { - if (jj_3R_108()) return true; - return false; - } - - private boolean jj_3R_57() { - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_105()) { jj_scanpos = xsp; break; } - } - if (jj_scan_token(PACKAGE)) return true; - if (jj_3R_101()) return true; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_410() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_419()) { - jj_scanpos = xsp; - if (jj_3R_420()) return true; - } - if (jj_scan_token(COLON)) return true; - if (jj_3R_171()) return true; - return false; - } - - private boolean jj_3_5() { - if (jj_3R_58()) return true; - return false; - } - - private boolean jj_3_28() { - if (jj_scan_token(DOT)) return true; - if (jj_scan_token(IDENTIFIER)) return true; - return false; - } - - private boolean jj_3_4() { - if (jj_3R_57()) return true; - return false; - } - - private boolean jj_3R_101() { - if (jj_scan_token(IDENTIFIER)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_28()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_400() { - if (jj_3R_410()) return true; - return false; - } - - private boolean jj_3R_154() { - if (jj_3R_73()) return true; - return false; - } - - private boolean jj_3R_153() { - if (jj_scan_token(VOID)) return true; - return false; - } - - private boolean jj_3R_345() { - if (jj_scan_token(SWITCH)) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_85()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_scan_token(LBRACE)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_400()) { jj_scanpos = xsp; break; } - } - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_308() { - if (jj_scan_token(SUPER)) return true; - if (jj_3R_81()) return true; - return false; - } - - private boolean jj_3R_307() { - if (jj_scan_token(EXTENDS)) return true; - if (jj_3R_81()) return true; - return false; - } - - private boolean jj_3R_290() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_307()) { - jj_scanpos = xsp; - if (jj_3R_308()) return true; - } - return false; - } - - private boolean jj_3R_418() { - if (jj_3R_84()) return true; - if (jj_3R_85()) return true; - return false; - } - - private boolean jj_3R_95() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_153()) { - jj_scanpos = xsp; - if (jj_3R_154()) return true; - } - return false; - } - - private boolean jj_3R_417() { - if (jj_scan_token(DECR)) return true; - return false; - } - - private boolean jj_3R_416() { - if (jj_scan_token(INCR)) return true; - return false; - } - - private boolean jj_3R_409() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_416()) { - jj_scanpos = xsp; - if (jj_3R_417()) { - jj_scanpos = xsp; - if (jj_3R_418()) return true; - } - } - return false; - } - - private boolean jj_3_3() { - if (jj_3R_58()) return true; - return false; - } - - private boolean jj_3R_361() { - if (jj_3R_292()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_409()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_360() { - if (jj_3R_260()) return true; - return false; - } - - private boolean jj_3R_359() { - if (jj_3R_259()) return true; - return false; - } - - private boolean jj_3_2() { - if (jj_3R_58()) return true; - return false; - } - - private boolean jj_3R_224() { - if (jj_scan_token(HOOK)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_290()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3_1() { - if (jj_3R_57()) return true; - return false; - } - - private boolean jj_3R_344() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_359()) { - jj_scanpos = xsp; - if (jj_3R_360()) { - jj_scanpos = xsp; - if (jj_3R_361()) return true; - } - } - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3_24() { - if (jj_3R_77()) return true; - if (jj_scan_token(LBRACKET)) return true; - return false; - } - - private boolean jj_3R_216() { - if (jj_scan_token(DOUBLE)) return true; - return false; - } - - private boolean jj_3R_215() { - if (jj_scan_token(FLOAT)) return true; - return false; - } - - private boolean jj_3R_399() { - if (jj_scan_token(COLON)) return true; - if (jj_3R_85()) return true; - return false; - } - - private boolean jj_3R_214() { - if (jj_scan_token(LONG)) return true; - return false; - } - - private boolean jj_3R_213() { - if (jj_scan_token(INT)) return true; - return false; - } - - private boolean jj_3_23() { - if (jj_3R_77()) return true; - if (jj_scan_token(LBRACKET)) return true; - return false; - } - - private boolean jj_3R_212() { - if (jj_scan_token(SHORT)) return true; - return false; - } - - private boolean jj_3R_343() { - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_191() { - if (jj_3R_77()) return true; - if (jj_scan_token(LBRACKET)) return true; - if (jj_scan_token(RBRACKET)) return true; - return false; - } - - private boolean jj_3R_211() { - if (jj_scan_token(BYTE)) return true; - return false; - } - - private boolean jj_3R_210() { - if (jj_scan_token(CHAR)) return true; - return false; - } - - private boolean jj_3R_209() { - if (jj_scan_token(BOOLEAN)) return true; - return false; - } - - private boolean jj_3_27() { - if (jj_3R_82()) return true; - return false; - } - - private boolean jj_3R_170() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_209()) { - jj_scanpos = xsp; - if (jj_3R_210()) { - jj_scanpos = xsp; - if (jj_3R_211()) { - jj_scanpos = xsp; - if (jj_3R_212()) { - jj_scanpos = xsp; - if (jj_3R_213()) { - jj_scanpos = xsp; - if (jj_3R_214()) { - jj_scanpos = xsp; - if (jj_3R_215()) { - jj_scanpos = xsp; - if (jj_3R_216()) return true; - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3_26() { - if (jj_scan_token(DOT)) return true; - if (jj_scan_token(IDENTIFIER)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3_27()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_190() { - if (jj_3R_77()) return true; - if (jj_scan_token(LBRACKET)) return true; - if (jj_scan_token(RBRACKET)) return true; - return false; - } - - private boolean jj_3_47() { - if (jj_3R_100()) return true; - return false; - } - - private boolean jj_3R_100() { - if (jj_3R_99()) return true; - if (jj_3R_73()) return true; - if (jj_3R_156()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_157()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3_46() { - if (jj_3R_99()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(20)) { - jj_scanpos = xsp; - if (jj_scan_token(40)) return true; - } - return false; - } - - private boolean jj_3_25() { - if (jj_3R_82()) return true; - return false; - } - - private boolean jj_3R_282() { - if (jj_3R_303()) return true; - return false; - } - - private boolean jj_3R_186() { - if (jj_scan_token(IDENTIFIER)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3_25()) jj_scanpos = xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_26()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_281() { - if (jj_3R_100()) return true; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_280() { - if (jj_3R_99()) return true; - if (jj_3R_202()) return true; - return false; - } - - private boolean jj_3R_125() { - if (jj_3R_186()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_191()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_124() { - if (jj_3R_170()) return true; - Token xsp; - if (jj_3R_190()) return true; - while (true) { - xsp = jj_scanpos; - if (jj_3R_190()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_247() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_280()) { - jj_scanpos = xsp; - if (jj_3R_281()) { - jj_scanpos = xsp; - if (jj_3R_282()) return true; - } - } - return false; - } - - private boolean jj_3R_83() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_124()) { - jj_scanpos = xsp; - if (jj_3R_125()) return true; - } - return false; - } - - private boolean jj_3R_111() { - if (jj_3R_170()) return true; - return false; - } - - private boolean jj_3_22() { - if (jj_3R_83()) return true; - return false; - } - - private boolean jj_3_43() { - if (jj_scan_token(LBRACKET)) return true; - if (jj_scan_token(RBRACKET)) return true; - return false; - } - - private boolean jj_3R_113() { - if (jj_scan_token(LBRACE)) return true; - if (jj_3R_171()) return true; - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_73() { - Token xsp; - xsp = jj_scanpos; - if (jj_3_22()) { - jj_scanpos = xsp; - if (jj_3R_111()) return true; - } - return false; - } - - private boolean jj_3R_98() { - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_scan_token(COLON)) return true; - if (jj_3R_303()) return true; - return false; - } - - private boolean jj_3R_342() { - if (jj_scan_token(ASSERT)) return true; - if (jj_3R_85()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_399()) jj_scanpos = xsp; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_332() { - if (jj_3R_355()) return true; - return false; - } - - private boolean jj_3R_149() { - if (jj_scan_token(DOUBLE)) return true; - return false; - } - - private boolean jj_3R_331() { - if (jj_3R_354()) return true; - return false; - } - - private boolean jj_3R_148() { - if (jj_scan_token(FLOAT)) return true; - return false; - } - - private boolean jj_3R_330() { - if (jj_3R_353()) return true; - return false; - } - - private boolean jj_3R_147() { - if (jj_scan_token(LONG)) return true; - return false; - } - - private boolean jj_3R_329() { - if (jj_3R_352()) return true; - return false; - } - - private boolean jj_3R_146() { - if (jj_scan_token(INT)) return true; - return false; - } - - private boolean jj_3R_328() { - if (jj_3R_351()) return true; - return false; - } - - private boolean jj_3R_145() { - if (jj_scan_token(SHORT)) return true; - return false; - } - - private boolean jj_3R_327() { - if (jj_3R_350()) return true; - return false; - } - - private boolean jj_3R_144() { - if (jj_scan_token(BYTE)) return true; - return false; - } - - private boolean jj_3R_326() { - if (jj_3R_349()) return true; - return false; - } - - private boolean jj_3R_143() { - if (jj_scan_token(CHAR)) return true; - return false; - } - - private boolean jj_3R_325() { - if (jj_3R_348()) return true; - return false; - } - - private boolean jj_3R_142() { - if (jj_scan_token(BOOLEAN)) return true; - return false; - } - - private boolean jj_3R_324() { - if (jj_3R_347()) return true; - return false; - } - - private boolean jj_3R_92() { - if (jj_3R_77()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_142()) { - jj_scanpos = xsp; - if (jj_3R_143()) { - jj_scanpos = xsp; - if (jj_3R_144()) { - jj_scanpos = xsp; - if (jj_3R_145()) { - jj_scanpos = xsp; - if (jj_3R_146()) { - jj_scanpos = xsp; - if (jj_3R_147()) { - jj_scanpos = xsp; - if (jj_3R_148()) { - jj_scanpos = xsp; - if (jj_3R_149()) return true; - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_323() { - if (jj_3R_346()) return true; - return false; - } - - private boolean jj_3R_184() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_123()) return true; - return false; - } - - private boolean jj_3R_322() { - if (jj_3R_345()) return true; - return false; - } - - private boolean jj_3R_321() { - if (jj_3R_344()) return true; - return false; - } - - private boolean jj_3R_320() { - if (jj_3R_343()) return true; - return false; - } - - private boolean jj_3R_319() { - if (jj_3R_113()) return true; - return false; - } - - private boolean jj_3R_318() { - if (jj_3R_342()) return true; - return false; - } - - private boolean jj_3_45() { - if (jj_3R_98()) return true; - return false; - } - - private boolean jj_3R_303() { - Token xsp; - xsp = jj_scanpos; - if (jj_3_45()) { - jj_scanpos = xsp; - if (jj_3R_318()) { - jj_scanpos = xsp; - if (jj_3R_319()) { - jj_scanpos = xsp; - if (jj_3R_320()) { - jj_scanpos = xsp; - if (jj_3R_321()) { - jj_scanpos = xsp; - if (jj_3R_322()) { - jj_scanpos = xsp; - if (jj_3R_323()) { - jj_scanpos = xsp; - if (jj_3R_324()) { - jj_scanpos = xsp; - if (jj_3R_325()) { - jj_scanpos = xsp; - if (jj_3R_326()) { - jj_scanpos = xsp; - if (jj_3R_327()) { - jj_scanpos = xsp; - if (jj_3R_328()) { - jj_scanpos = xsp; - if (jj_3R_329()) { - jj_scanpos = xsp; - if (jj_3R_330()) { - jj_scanpos = xsp; - if (jj_3R_331()) { - jj_scanpos = xsp; - if (jj_3R_332()) return true; - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_333() { - if (jj_scan_token(LBRACKET)) return true; - if (jj_scan_token(RBRACKET)) return true; - return false; - } - - private boolean jj_3R_306() { - Token xsp; - if (jj_3R_333()) return true; - while (true) { - xsp = jj_scanpos; - if (jj_3R_333()) { jj_scanpos = xsp; break; } - } - if (jj_3R_172()) return true; - return false; - } - - private boolean jj_3R_189() { - if (jj_3R_224()) return true; - return false; - } - - private boolean jj_3_42() { - if (jj_scan_token(LBRACKET)) return true; - if (jj_3R_85()) return true; - if (jj_scan_token(RBRACKET)) return true; - return false; - } - - private boolean jj_3R_188() { - if (jj_3R_83()) return true; - return false; - } - - private boolean jj_3_44() { - Token xsp; - if (jj_3_42()) return true; - while (true) { - xsp = jj_scanpos; - if (jj_3_42()) { jj_scanpos = xsp; break; } - } - while (true) { - xsp = jj_scanpos; - if (jj_3_43()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3_18() { - if (jj_3R_77()) return true; - if (jj_scan_token(LBRACKET)) return true; - return false; - } - - private boolean jj_3R_123() { - if (jj_3R_77()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_188()) { - jj_scanpos = xsp; - if (jj_3R_189()) return true; - } - return false; - } - - private boolean jj_3_41() { - if (jj_3R_97()) return true; - return false; - } - - private boolean jj_3R_286() { - Token xsp; - xsp = jj_scanpos; - if (jj_3_44()) { - jj_scanpos = xsp; - if (jj_3R_306()) return true; - } - return false; - } - - private boolean jj_3_17() { - if (jj_3R_77()) return true; - if (jj_scan_token(LBRACKET)) return true; - return false; - } - - private boolean jj_3R_82() { - if (jj_scan_token(LT)) return true; - if (jj_3R_123()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_184()) { jj_scanpos = xsp; break; } - } - if (jj_scan_token(GT)) return true; - return false; - } - - private boolean jj_3R_187() { - if (jj_3R_77()) return true; - if (jj_scan_token(LBRACKET)) return true; - if (jj_scan_token(RBRACKET)) return true; - return false; - } - - private boolean jj_3_21() { - if (jj_3R_82()) return true; - return false; - } - - private boolean jj_3_20() { - if (jj_scan_token(DOT)) return true; - if (jj_scan_token(IDENTIFIER)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3_21()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_185() { - if (jj_3R_77()) return true; - if (jj_scan_token(LBRACKET)) return true; - if (jj_scan_token(RBRACKET)) return true; - return false; - } - - private boolean jj_3R_289() { - if (jj_3R_174()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3_41()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_283() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_85()) return true; - return false; - } - - private boolean jj_3_19() { - if (jj_3R_82()) return true; - return false; - } - - private boolean jj_3R_287() { - if (jj_3R_82()) return true; - return false; - } - - private boolean jj_3R_278() { - if (jj_3R_77()) return true; - if (jj_scan_token(IDENTIFIER)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3_19()) jj_scanpos = xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_20()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_257() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_287()) jj_scanpos = xsp; - if (jj_3R_186()) return true; - xsp = jj_scanpos; - if (jj_3R_288()) { - jj_scanpos = xsp; - if (jj_3R_289()) return true; - } - return false; - } - - private boolean jj_3R_288() { - if (jj_3R_286()) return true; - return false; - } - - private boolean jj_3R_256() { - if (jj_3R_170()) return true; - if (jj_3R_286()) return true; - return false; - } - - private boolean jj_3R_122() { - if (jj_3R_186()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_187()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_121() { - if (jj_3R_170()) return true; - Token xsp; - if (jj_3R_185()) return true; - while (true) { - xsp = jj_scanpos; - if (jj_3R_185()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_222() { - if (jj_scan_token(NEW)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_256()) { - jj_scanpos = xsp; - if (jj_3R_257()) return true; - } - return false; - } - - private boolean jj_3R_81() { - if (jj_3R_77()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_121()) { - jj_scanpos = xsp; - if (jj_3R_122()) return true; - } - return false; - } - - private boolean jj_3R_161() { - if (jj_3R_92()) return true; - return false; - } - - private boolean jj_3_16() { - if (jj_3R_81()) return true; - return false; - } - - private boolean jj_3R_248() { - if (jj_3R_85()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_283()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_104() { - Token xsp; - xsp = jj_scanpos; - if (jj_3_16()) { - jj_scanpos = xsp; - if (jj_3R_161()) return true; - } - return false; - } - - private boolean jj_3R_218() { - if (jj_3R_248()) return true; - return false; - } - - private boolean jj_3R_174() { - if (jj_scan_token(LPAREN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_218()) jj_scanpos = xsp; - if (jj_scan_token(RPAREN)) return true; - return false; - } - - private boolean jj_3R_112() { - if (jj_scan_token(STATIC)) return true; - return false; - } - - private boolean jj_3R_75() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_112()) jj_scanpos = xsp; - if (jj_3R_113()) return true; - return false; - } - - private boolean jj_3R_305() { - if (jj_scan_token(FALSE)) return true; - return false; - } - - private boolean jj_3R_285() { - if (jj_scan_token(NULL)) return true; - return false; - } - - private boolean jj_3R_217() { - if (jj_3R_247()) return true; - return false; - } - - private boolean jj_3R_304() { - if (jj_scan_token(TRUE)) return true; - return false; - } - - private boolean jj_3R_171() { - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_217()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3_14() { - if (jj_3R_79()) return true; - if (jj_scan_token(DOT)) return true; - return false; - } - - private boolean jj_3R_284() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_304()) { - jj_scanpos = xsp; - if (jj_3R_305()) return true; - } - return false; - } - - private boolean jj_3R_80() { - if (jj_3R_82()) return true; - return false; - } - - private boolean jj_3R_176() { - if (jj_3R_82()) return true; - return false; - } - - private boolean jj_3R_255() { - if (jj_3R_285()) return true; - return false; - } - - private boolean jj_3_15() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_80()) jj_scanpos = xsp; - if (jj_scan_token(THIS)) return true; - if (jj_scan_token(LPAREN)) return true; - return false; - } - - private boolean jj_3R_254() { - if (jj_3R_284()) return true; - return false; - } - - private boolean jj_3R_175() { - if (jj_3R_79()) return true; - if (jj_scan_token(DOT)) return true; - return false; - } - - private boolean jj_3R_118() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_175()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_176()) jj_scanpos = xsp; - if (jj_scan_token(SUPER)) return true; - if (jj_3R_174()) return true; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_253() { - if (jj_scan_token(STRING_LITERAL)) return true; - return false; - } - - private boolean jj_3R_173() { - if (jj_3R_82()) return true; - return false; - } - - private boolean jj_3R_371() { - if (jj_3R_377()) return true; - return false; - } - - private boolean jj_3R_252() { - if (jj_scan_token(CHARACTER_LITERAL)) return true; - return false; - } - - private boolean jj_3R_117() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_173()) jj_scanpos = xsp; - if (jj_scan_token(THIS)) return true; - if (jj_3R_174()) return true; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_251() { - if (jj_scan_token(FLOATING_POINT_LITERAL)) return true; - return false; - } - - private boolean jj_3_11() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_76()) return true; - return false; - } - - private boolean jj_3R_250() { - if (jj_scan_token(LONG_LITERAL)) return true; - return false; - } - - private boolean jj_3R_78() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_117()) { - jj_scanpos = xsp; - if (jj_3R_118()) return true; - } - return false; - } - - private boolean jj_3R_249() { - if (jj_scan_token(INTEGER_LITERAL)) return true; - return false; - } - - private boolean jj_3_12() { - if (jj_3R_77()) return true; - if (jj_scan_token(ELLIPSIS)) return true; - return false; - } - - private boolean jj_3R_96() { - if (jj_3R_82()) return true; - return false; - } - - private boolean jj_3_40() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_96()) jj_scanpos = xsp; - if (jj_scan_token(IDENTIFIER)) return true; - return false; - } - - private boolean jj_3_13() { - if (jj_3R_78()) return true; - return false; - } - - private boolean jj_3R_219() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_249()) { - jj_scanpos = xsp; - if (jj_3R_250()) { - jj_scanpos = xsp; - if (jj_3R_251()) { - jj_scanpos = xsp; - if (jj_3R_252()) { - jj_scanpos = xsp; - if (jj_3R_253()) { - jj_scanpos = xsp; - if (jj_3R_254()) { - jj_scanpos = xsp; - if (jj_3R_255()) return true; - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_383() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_382()) return true; - return false; - } - - private boolean jj_3R_152() { - if (jj_scan_token(LBRACKET)) return true; - if (jj_3R_85()) return true; - if (jj_scan_token(RBRACKET)) return true; - return false; - } - - private boolean jj_3R_234() { - if (jj_3R_174()) return true; - return false; - } - - private boolean jj_3R_387() { - if (jj_3R_77()) return true; - if (jj_scan_token(ELLIPSIS)) return true; - return false; - } - - private boolean jj_3R_233() { - if (jj_3R_82()) return true; - return false; - } - - private boolean jj_3R_376() { - if (jj_3R_78()) return true; - return false; - } - - private boolean jj_3R_197() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_233()) jj_scanpos = xsp; - if (jj_scan_token(IDENTIFIER)) return true; - xsp = jj_scanpos; - if (jj_3R_234()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_196() { - if (jj_3R_222()) return true; - return false; - } - - private boolean jj_3R_368() { - if (jj_scan_token(LBRACKET)) return true; - if (jj_scan_token(RBRACKET)) return true; - return false; - } - - private boolean jj_3R_366() { - if (jj_scan_token(LBRACE)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_376()) jj_scanpos = xsp; - if (jj_3R_171()) return true; - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_195() { - if (jj_scan_token(THIS)) return true; - return false; - } - - private boolean jj_3R_365() { - if (jj_scan_token(THROWS)) return true; - if (jj_3R_375()) return true; - return false; - } - - private boolean jj_3R_311() { - if (jj_3R_110()) return true; - return false; - } - - private boolean jj_3R_294() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_311()) jj_scanpos = xsp; - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_3R_364()) return true; - if (jj_3R_77()) return true; - xsp = jj_scanpos; - if (jj_3R_365()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_366()) { - jj_scanpos = xsp; - if (jj_scan_token(86)) return true; - } - return false; - } - - private boolean jj_3R_151() { - if (jj_scan_token(DOT)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_195()) { - jj_scanpos = xsp; - if (jj_3R_196()) { - jj_scanpos = xsp; - if (jj_3R_197()) return true; - } - } - return false; - } - - private boolean jj_3R_377() { - if (jj_scan_token(_DEFAULT)) return true; - if (jj_3R_103()) return true; - return false; - } - - private boolean jj_3R_94() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_151()) { - jj_scanpos = xsp; - if (jj_3R_152()) return true; - } - return false; - } - - private boolean jj_3R_150() { - if (jj_scan_token(DOT)) return true; - if (jj_scan_token(SUPER)) return true; - return false; - } - - private boolean jj_3R_358() { - if (jj_3R_104()) return true; - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_scan_token(RPAREN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_371()) jj_scanpos = xsp; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3_39() { - if (jj_3R_94()) return true; - return false; - } - - private boolean jj_3R_237() { - if (jj_scan_token(LBRACKET)) return true; - if (jj_scan_token(RBRACKET)) return true; - return false; - } - - private boolean jj_3_53() { - if (jj_3R_104()) return true; - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_scan_token(LPAREN)) return true; - return false; - } - - private boolean jj_3R_341() { - if (jj_3R_295()) return true; - return false; - } - - private boolean jj_3R_382() { - if (jj_3R_99()) return true; - if (jj_3R_73()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_387()) jj_scanpos = xsp; - if (jj_3R_199()) return true; - return false; - } - - private boolean jj_3R_340() { - if (jj_3R_204()) return true; - return false; - } - - private boolean jj_3R_223() { - if (jj_3R_174()) return true; - return false; - } - - private boolean jj_3R_339() { - if (jj_3R_203()) return true; - return false; - } - - private boolean jj_3R_93() { - Token xsp; - xsp = jj_scanpos; - if (jj_3_39()) { - jj_scanpos = xsp; - if (jj_3R_150()) return true; - } - return false; - } - - private boolean jj_3_38() { - if (jj_3R_95()) return true; - if (jj_scan_token(DOT)) return true; - if (jj_scan_token(CLASS)) return true; - return false; - } - - private boolean jj_3R_313() { - if (jj_3R_76()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_11()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_338() { - if (jj_3R_202()) return true; - return false; - } - - private boolean jj_3R_183() { - if (jj_scan_token(IDENTIFIER)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_223()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_337() { - if (jj_3R_358()) return true; - return false; - } - - private boolean jj_3R_374() { - if (jj_3R_382()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_383()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3_52() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_103()) return true; - return false; - } - - private boolean jj_3R_182() { - if (jj_3R_95()) return true; - if (jj_scan_token(DOT)) return true; - if (jj_scan_token(CLASS)) return true; - return false; - } - - private boolean jj_3R_364() { - if (jj_scan_token(LPAREN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_374()) jj_scanpos = xsp; - if (jj_scan_token(RPAREN)) return true; - return false; - } - - private boolean jj_3R_316() { - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_181() { - if (jj_3R_222()) return true; - return false; - } - - private boolean jj_3R_317() { - if (jj_3R_99()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_337()) { - jj_scanpos = xsp; - if (jj_3R_338()) { - jj_scanpos = xsp; - if (jj_3R_339()) { - jj_scanpos = xsp; - if (jj_3R_340()) { - jj_scanpos = xsp; - if (jj_3R_341()) return true; - } - } - } - } - return false; - } - - private boolean jj_3R_180() { - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_85()) return true; - if (jj_scan_token(RPAREN)) return true; - return false; - } - - private boolean jj_3R_302() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_316()) { - jj_scanpos = xsp; - if (jj_3R_317()) return true; - } - return false; - } - - private boolean jj_3_37() { - if (jj_3R_94()) return true; - return false; - } - - private boolean jj_3R_221() { - if (jj_3R_174()) return true; - return false; - } - - private boolean jj_3R_220() { - if (jj_3R_82()) return true; - return false; - } - - private boolean jj_3R_277() { - if (jj_3R_302()) return true; - return false; - } - - private boolean jj_3R_179() { - if (jj_scan_token(SUPER)) return true; - if (jj_scan_token(DOT)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_220()) jj_scanpos = xsp; - if (jj_scan_token(IDENTIFIER)) return true; - xsp = jj_scanpos; - if (jj_3R_221()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_178() { - if (jj_scan_token(THIS)) return true; - return false; - } - - private boolean jj_3R_370() { - if (jj_3R_113()) return true; - return false; - } - - private boolean jj_3R_369() { - if (jj_scan_token(THROWS)) return true; - if (jj_3R_375()) return true; - return false; - } - - private boolean jj_3R_177() { - if (jj_3R_219()) return true; - return false; - } - - private boolean jj_3R_120() { - if (jj_3R_94()) return true; - return false; - } - - private boolean jj_3R_245() { - if (jj_scan_token(LBRACE)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_277()) { jj_scanpos = xsp; break; } - } - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_312() { - if (jj_3R_110()) return true; - return false; - } - - private boolean jj_3R_296() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_312()) jj_scanpos = xsp; - if (jj_3R_77()) return true; - if (jj_3R_95()) return true; - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_3R_364()) return true; - while (true) { - xsp = jj_scanpos; - if (jj_3R_368()) { jj_scanpos = xsp; break; } - } - if (jj_3R_77()) return true; - xsp = jj_scanpos; - if (jj_3R_369()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_370()) { - jj_scanpos = xsp; - if (jj_scan_token(86)) return true; - } - return false; - } - - private boolean jj_3R_119() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_177()) { - jj_scanpos = xsp; - if (jj_3R_178()) { - jj_scanpos = xsp; - if (jj_3R_179()) { - jj_scanpos = xsp; - if (jj_3R_180()) { - jj_scanpos = xsp; - if (jj_3R_181()) { - jj_scanpos = xsp; - if (jj_3R_182()) { - jj_scanpos = xsp; - if (jj_3R_183()) return true; - } - } - } - } - } - } - return false; - } - - private boolean jj_3_36() { - if (jj_3R_93()) return true; - return false; - } - - private boolean jj_3R_204() { - if (jj_scan_token(AT)) return true; - if (jj_scan_token(INTERFACE)) return true; - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_3R_245()) return true; - return false; - } - - private boolean jj_3R_315() { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_314()) return true; - return false; - } - - private boolean jj_3R_336() { - if (jj_3R_103()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_52()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_79() { - if (jj_3R_119()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_120()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_172() { - if (jj_scan_token(LBRACE)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_313()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_scan_token(87)) jj_scanpos = xsp; - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_273() { - if (jj_3R_297()) return true; - return false; - } - - private boolean jj_3R_201() { - if (jj_scan_token(LBRACE)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_336()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_scan_token(87)) jj_scanpos = xsp; - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_115() { - if (jj_3R_85()) return true; - return false; - } - - private boolean jj_3R_114() { - if (jj_3R_172()) return true; - return false; - } - - private boolean jj_3R_200() { - if (jj_scan_token(ASSIGN)) return true; - if (jj_3R_76()) return true; - return false; - } - - private boolean jj_3R_160() { - if (jj_3R_138()) return true; - return false; - } - - private boolean jj_3R_292() { - if (jj_3R_119()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_36()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_159() { - if (jj_3R_201()) return true; - return false; - } - - private boolean jj_3R_141() { - if (jj_3R_81()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_194()) return true; - return false; - } - - private boolean jj_3R_158() { - if (jj_3R_108()) return true; - return false; - } - - private boolean jj_3_35() { - if (jj_3R_92()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_193()) return true; - return false; - } - - private boolean jj_3R_76() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_114()) { - jj_scanpos = xsp; - if (jj_3R_115()) return true; - } - return false; - } - - private boolean jj_3R_103() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_158()) { - jj_scanpos = xsp; - if (jj_3R_159()) { - jj_scanpos = xsp; - if (jj_3R_160()) return true; - } - } - return false; - } - - private boolean jj_3R_89() { - if (jj_scan_token(LPAREN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3_35()) { - jj_scanpos = xsp; - if (jj_3R_141()) return true; - } - return false; - } - - private boolean jj_3R_199() { - if (jj_scan_token(IDENTIFIER)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_237()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_314() { - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_scan_token(ASSIGN)) return true; - if (jj_3R_103()) return true; - return false; - } - - private boolean jj_3R_74() { - if (jj_scan_token(LBRACKET)) return true; - if (jj_scan_token(RBRACKET)) return true; - return false; - } - - private boolean jj_3R_91() { - if (jj_scan_token(DECR)) return true; - return false; - } - - private boolean jj_3_34() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_90()) { - jj_scanpos = xsp; - if (jj_3R_91()) return true; - } - return false; - } - - private boolean jj_3R_90() { - if (jj_scan_token(INCR)) return true; - return false; - } - - private boolean jj_3R_156() { - if (jj_3R_199()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_200()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3_33() { - if (jj_3R_89()) return true; - return false; - } - - private boolean jj_3R_297() { - if (jj_3R_314()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_315()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_208() { - if (jj_3R_246()) return true; - return false; - } - - /** Generated Token Manager. */ - public ASTParserTokenManager token_source; - JavaCharStream jj_input_stream; - /** Current token. */ - public Token token; - /** Next token. */ - public Token jj_nt; - private int jj_ntk; - private Token jj_scanpos, jj_lastpos; - private int jj_la; - /** Whether we are looking ahead. */ - private boolean jj_lookingAhead = false; - private boolean jj_semLA; - private int jj_gen; - final private int[] jj_la1 = new int[144]; - static private int[] jj_la1_0; - static private int[] jj_la1_1; - static private int[] jj_la1_2; - static private int[] jj_la1_3; - static private int[] jj_la1_4; - static { - jj_la1_init_0(); - jj_la1_init_1(); - jj_la1_init_2(); - jj_la1_init_3(); - jj_la1_init_4(); - } - private static void jj_la1_init_0() { - jj_la1_0 = new int[] {0x0,0x0,0x0,0x1,0x0,0x1,0x0,0x0,0x0,0x40001000,0x8100000,0x48101000,0x100000,0x0,0x10000000,0x0,0x0,0x0,0x0,0x0,0x0,0x4a195000,0x0,0x0,0x0,0x0,0x0,0x10000000,0x0,0x4a195000,0x8100000,0x2094000,0x4a195000,0x0,0x0,0x0,0x22094000,0x22094000,0x0,0x0,0x0,0x0,0x0,0x0,0x42095000,0x0,0x0,0x0,0x0,0x0,0x22094000,0x6359f000,0x0,0x2094000,0x2094000,0x0,0x2094000,0x10000000,0x10000000,0x2094000,0x2094000,0x2094000,0x2094000,0x2094000,0x10000000,0x10000000,0x2094000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x22094000,0x0,0x0,0x22094000,0x0,0x2094000,0x0,0x0,0x0,0x20000000,0x0,0x0,0x0,0x0,0x0,0x0,0x20000000,0x20000000,0x22094000,0x0,0x0,0x0,0x2094000,0x0,0x0,0x2349e000,0x0,0x2349e000,0x0,0x0,0x0,0x22094000,0x820000,0x820000,0x4000000,0x62095000,0x22094000,0x22094000,0x62095000,0x22094000,0x0,0x0,0x0,0x22094000,0x40000,0x80000000,0x80040000,0x0,0x0,0x0,0x0,0x22094000,0x22094000,0x0,0x4a195000,0xa194000,0x4a195000,0x800000,}; - } - private static void jj_la1_init_1() { - jj_la1_1 = new int[] {0x20,0x2000,0x20,0x0,0x20,0x0,0x0,0x80000,0x0,0x8899c400,0x100,0x8899c500,0x100,0x0,0x0,0x10,0x0,0x0,0x10,0x0,0x0,0xc89dc781,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc89dc781,0x100,0x40040281,0xc89dc781,0x0,0x0,0x0,0x51241a81,0x51241a81,0x0,0x0,0x0,0x4000000,0x0,0x0,0x889dc681,0x0,0x4000000,0x0,0x0,0x0,0x51241a81,0xfbffdf8b,0x80000,0x40281,0x40281,0x0,0x40281,0x200000,0x200000,0x40281,0x40040281,0x40281,0x40281,0x40281,0x200000,0x200000,0x40040281,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x51241a81,0x0,0x0,0x51241a81,0x0,0x40281,0x0,0x0,0x0,0x11201800,0x0,0x0,0x0,0x0,0x1000800,0x0,0x10001000,0x10000000,0x51241a81,0x0,0x0,0x0,0x40281,0x0,0x0,0x73e61a8b,0x0,0x73e61a8b,0x0,0x0,0x0,0x51241a81,0x0,0x0,0x0,0xd9bdde81,0x51241a81,0x51241a81,0xd9bdde81,0x51241a81,0x0,0x0,0x0,0x51241a81,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x51241a81,0x51241a81,0x0,0x889dc781,0x40381,0x889dc781,0x0,}; - } - private static void jj_la1_init_2() { - jj_la1_2 = new int[] {0x0,0x2000000,0x0,0x0,0x0,0x0,0x2000000,0x0,0x1000000,0x2000000,0x2000000,0x2400000,0x0,0x8000000,0x0,0x0,0x800000,0x800000,0x0,0x2002000,0x800000,0xa442000,0x400000,0x2000000,0x10000,0x40000,0x800000,0x0,0x0,0xa442000,0x2000000,0xa002000,0xa402000,0x800000,0x4000000,0x100000,0x30053846,0x30053846,0x800000,0x8000000,0x100000,0x0,0x440000,0x800000,0x2002000,0x8000000,0x0,0x440000,0x8000000,0x8000000,0x8013846,0x2453847,0x0,0x2000000,0x2000,0x800000,0x40002000,0x0,0x0,0x0,0x2002000,0x0,0x2000,0x0,0x0,0x0,0x2000,0x800000,0x4000000,0x40000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x8000000,0x8000000,0x0,0x0,0x0,0x0,0x0,0x0,0x30013846,0x30000000,0x30000000,0x13846,0x0,0x2002000,0x8000000,0x10000,0x10000,0x11846,0x2000,0x1000000,0x8000000,0x10000,0x0,0x1100000,0x1846,0x0,0x30013846,0x800000,0x8000000,0x110000,0x8002000,0x100000,0x100000,0x453847,0x80000000,0x453847,0x800000,0x4000000,0x4000000,0x13846,0x0,0x0,0x0,0x32013846,0x30013846,0x30013846,0x32413846,0x30013846,0x800000,0x2000,0x2000,0x30013846,0x0,0x0,0x0,0x2000000,0x2000000,0x2000,0x800000,0x32053846,0x32053846,0x800000,0x2402000,0x2002000,0x2402000,0x0,}; - } - private static void jj_la1_init_3() { - jj_la1_3 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3c0,0x3c0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xffe0000,0x0,0x10,0x20,0x2000,0x4000,0x1000,0x9,0x9,0x0,0x80000006,0x80000006,0x10000,0x300,0x300,0x8c00,0x8c00,0x300,0x3c0,0x0,0x0,0x0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3c0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0x0,0xc0,0x0,0xffe00c0,0xffe00c0,0xc0,0x0,0x0,0x0,0x3c0,0x3c0,0x3c0,0x3c0,0x3c0,0x0,0x0,0x0,0x3c0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3c0,0x3c0,0x0,0x0,0x0,0x0,0x0,}; - } - private static void jj_la1_init_4() { - jj_la1_4 = new int[] {0x0,0x0,0x0,0x1,0x0,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,}; - } - final private JJCalls[] jj_2_rtns = new JJCalls[53]; - private boolean jj_rescan = false; - private int jj_gc = 0; - - /** Constructor with InputStream. */ - public ASTParser(java.io.InputStream stream) { - this(stream, null); - } - /** Constructor with InputStream and supplied encoding */ - public ASTParser(java.io.InputStream stream, String encoding) { - try { jj_input_stream = new JavaCharStream(stream, encoding, 1, 1); } catch (java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } - token_source = new ASTParserTokenManager(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 144; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** Reinitialise. */ - public void ReInit(java.io.InputStream stream) { - ReInit(stream, null); - } - /** Reinitialise. */ - public void ReInit(java.io.InputStream stream, String encoding) { - try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch (java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } - token_source.ReInit(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 144; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** Constructor. */ - public ASTParser(java.io.Reader stream) { - jj_input_stream = new JavaCharStream(stream, 1, 1); - token_source = new ASTParserTokenManager(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 144; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** Reinitialise. */ - public void ReInit(java.io.Reader stream) { - jj_input_stream.ReInit(stream, 1, 1); - token_source.ReInit(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 144; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** Constructor with generated Token Manager. */ - public ASTParser(ASTParserTokenManager tm) { - token_source = tm; - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 144; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** Reinitialise. */ - public void ReInit(ASTParserTokenManager tm) { - token_source = tm; - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 144; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - private Token jj_consume_token(int kind) throws ParseException { - Token oldToken; - if ((oldToken = token).next != null) token = token.next; - else token = token.next = token_source.getNextToken(); - jj_ntk = -1; - if (token.kind == kind) { - jj_gen++; - if (++jj_gc > 100) { - jj_gc = 0; - for (int i = 0; i < jj_2_rtns.length; i++) { - JJCalls c = jj_2_rtns[i]; - while (c != null) { - if (c.gen < jj_gen) c.first = null; - c = c.next; - } - } - } - return token; - } - token = oldToken; - jj_kind = kind; - throw generateParseException(); - } - - static private final class LookaheadSuccess extends java.lang.Error { } - final private LookaheadSuccess jj_ls = new LookaheadSuccess(); - private boolean jj_scan_token(int kind) { - if (jj_scanpos == jj_lastpos) { - jj_la--; - if (jj_scanpos.next == null) { - jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken(); - } else { - jj_lastpos = jj_scanpos = jj_scanpos.next; - } - } else { - jj_scanpos = jj_scanpos.next; - } - if (jj_rescan) { - int i = 0; Token tok = token; - while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; } - if (tok != null) jj_add_error_token(kind, i); - } - if (jj_scanpos.kind != kind) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls; - return false; - } - - -/** Get the next Token. */ - final public Token getNextToken() { - if (token.next != null) token = token.next; - else token = token.next = token_source.getNextToken(); - jj_ntk = -1; - jj_gen++; - return token; - } - -/** Get the specific Token. */ - final public Token getToken(int index) { - Token t = jj_lookingAhead ? jj_scanpos : token; - for (int i = 0; i < index; i++) { - if (t.next != null) t = t.next; - else t = t.next = token_source.getNextToken(); - } - return t; - } - - private int jj_ntk() { - if ((jj_nt=token.next) == null) { - return (jj_ntk = (token.next=token_source.getNextToken()).kind); - } else - return (jj_ntk = jj_nt.kind); - } - - private java.util.List jj_expentries = new java.util.ArrayList(); - private int[] jj_expentry; - private int jj_kind = -1; - private int[] jj_lasttokens = new int[100]; - private int jj_endpos; - - private void jj_add_error_token(int kind, int pos) { - if (pos >= 100) return; - if (pos == jj_endpos + 1) { - jj_lasttokens[jj_endpos++] = kind; - } else if (jj_endpos != 0) { - jj_expentry = new int[jj_endpos]; - for (int i = 0; i < jj_endpos; i++) { - jj_expentry[i] = jj_lasttokens[i]; - } - jj_entries_loop: for (java.util.Iterator it = jj_expentries.iterator(); it.hasNext();) { - int[] oldentry = (int[])(it.next()); - if (oldentry.length == jj_expentry.length) { - for (int i = 0; i < jj_expentry.length; i++) { - if (oldentry[i] != jj_expentry[i]) { - continue jj_entries_loop; - } - } - jj_expentries.add(jj_expentry); - break jj_entries_loop; - } - } - if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind; - } - } - - /** Generate ParseException. */ - public ParseException generateParseException() { - jj_expentries.clear(); - boolean[] la1tokens = new boolean[129]; - if (jj_kind >= 0) { - la1tokens[jj_kind] = true; - jj_kind = -1; - } - for (int i = 0; i < 144; i++) { - if (jj_la1[i] == jj_gen) { - for (int j = 0; j < 32; j++) { - if ((jj_la1_0[i] & (1< jj_gen) { - jj_la = p.arg; jj_lastpos = jj_scanpos = p.first; - switch (i) { - case 0: jj_3_1(); break; - case 1: jj_3_2(); break; - case 2: jj_3_3(); break; - case 3: jj_3_4(); break; - case 4: jj_3_5(); break; - case 5: jj_3_6(); break; - case 6: jj_3_7(); break; - case 7: jj_3_8(); break; - case 8: jj_3_9(); break; - case 9: jj_3_10(); break; - case 10: jj_3_11(); break; - case 11: jj_3_12(); break; - case 12: jj_3_13(); break; - case 13: jj_3_14(); break; - case 14: jj_3_15(); break; - case 15: jj_3_16(); break; - case 16: jj_3_17(); break; - case 17: jj_3_18(); break; - case 18: jj_3_19(); break; - case 19: jj_3_20(); break; - case 20: jj_3_21(); break; - case 21: jj_3_22(); break; - case 22: jj_3_23(); break; - case 23: jj_3_24(); break; - case 24: jj_3_25(); break; - case 25: jj_3_26(); break; - case 26: jj_3_27(); break; - case 27: jj_3_28(); break; - case 28: jj_3_29(); break; - case 29: jj_3_30(); break; - case 30: jj_3_31(); break; - case 31: jj_3_32(); break; - case 32: jj_3_33(); break; - case 33: jj_3_34(); break; - case 34: jj_3_35(); break; - case 35: jj_3_36(); break; - case 36: jj_3_37(); break; - case 37: jj_3_38(); break; - case 38: jj_3_39(); break; - case 39: jj_3_40(); break; - case 40: jj_3_41(); break; - case 41: jj_3_42(); break; - case 42: jj_3_43(); break; - case 43: jj_3_44(); break; - case 44: jj_3_45(); break; - case 45: jj_3_46(); break; - case 46: jj_3_47(); break; - case 47: jj_3_48(); break; - case 48: jj_3_49(); break; - case 49: jj_3_50(); break; - case 50: jj_3_51(); break; - case 51: jj_3_52(); break; - case 52: jj_3_53(); break; - } - } - p = p.next; - } while (p != null); - } catch (LookaheadSuccess ls) { } - } - jj_rescan = false; - } - - private void jj_save(int index, int xla) { - JJCalls p = jj_2_rtns[index]; - while (p.gen > jj_gen) { - if (p.next == null) { p = p.next = new JJCalls(); break; } - p = p.next; - } - p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla; - } - - static final class JJCalls { - int gen; - Token first; - int arg; - JJCalls next; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ASTParserConstants.java b/stubparser/src/org/checkerframework/stubparser/ASTParserConstants.java deleted file mode 100644 index 51c3c676ab5..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ASTParserConstants.java +++ /dev/null @@ -1,410 +0,0 @@ -/* Generated By:JavaCC: Do not edit this line. ASTParserConstants.java */ -/* - * Copyright (C) 2008 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -package org.checkerframework.stubparser; - - -/** - * Token literal values and constants. - * Generated by org.javacc.parser.OtherFilesGen#start() - */ -public interface ASTParserConstants { - - /** End of File. */ - int EOF = 0; - /** RegularExpression Id. */ - int SINGLE_LINE_COMMENT = 6; - /** RegularExpression Id. */ - int JAVA_DOC_COMMENT = 9; - /** RegularExpression Id. */ - int MULTI_LINE_COMMENT = 10; - /** RegularExpression Id. */ - int ABSTRACT = 12; - /** RegularExpression Id. */ - int ASSERT = 13; - /** RegularExpression Id. */ - int BOOLEAN = 14; - /** RegularExpression Id. */ - int BREAK = 15; - /** RegularExpression Id. */ - int BYTE = 16; - /** RegularExpression Id. */ - int CASE = 17; - /** RegularExpression Id. */ - int CATCH = 18; - /** RegularExpression Id. */ - int CHAR = 19; - /** RegularExpression Id. */ - int CLASS = 20; - /** RegularExpression Id. */ - int CONST = 21; - /** RegularExpression Id. */ - int CONTINUE = 22; - /** RegularExpression Id. */ - int _DEFAULT = 23; - /** RegularExpression Id. */ - int DO = 24; - /** RegularExpression Id. */ - int DOUBLE = 25; - /** RegularExpression Id. */ - int ELSE = 26; - /** RegularExpression Id. */ - int ENUM = 27; - /** RegularExpression Id. */ - int EXTENDS = 28; - /** RegularExpression Id. */ - int FALSE = 29; - /** RegularExpression Id. */ - int FINAL = 30; - /** RegularExpression Id. */ - int FINALLY = 31; - /** RegularExpression Id. */ - int FLOAT = 32; - /** RegularExpression Id. */ - int FOR = 33; - /** RegularExpression Id. */ - int GOTO = 34; - /** RegularExpression Id. */ - int IF = 35; - /** RegularExpression Id. */ - int IMPLEMENTS = 36; - /** RegularExpression Id. */ - int IMPORT = 37; - /** RegularExpression Id. */ - int INSTANCEOF = 38; - /** RegularExpression Id. */ - int INT = 39; - /** RegularExpression Id. */ - int INTERFACE = 40; - /** RegularExpression Id. */ - int LONG = 41; - /** RegularExpression Id. */ - int NATIVE = 42; - /** RegularExpression Id. */ - int NEW = 43; - /** RegularExpression Id. */ - int NULL = 44; - /** RegularExpression Id. */ - int PACKAGE = 45; - /** RegularExpression Id. */ - int PRIVATE = 46; - /** RegularExpression Id. */ - int PROTECTED = 47; - /** RegularExpression Id. */ - int PUBLIC = 48; - /** RegularExpression Id. */ - int RETURN = 49; - /** RegularExpression Id. */ - int SHORT = 50; - /** RegularExpression Id. */ - int STATIC = 51; - /** RegularExpression Id. */ - int STRICTFP = 52; - /** RegularExpression Id. */ - int SUPER = 53; - /** RegularExpression Id. */ - int SWITCH = 54; - /** RegularExpression Id. */ - int SYNCHRONIZED = 55; - /** RegularExpression Id. */ - int THIS = 56; - /** RegularExpression Id. */ - int THROW = 57; - /** RegularExpression Id. */ - int THROWS = 58; - /** RegularExpression Id. */ - int TRANSIENT = 59; - /** RegularExpression Id. */ - int TRUE = 60; - /** RegularExpression Id. */ - int TRY = 61; - /** RegularExpression Id. */ - int VOID = 62; - /** RegularExpression Id. */ - int VOLATILE = 63; - /** RegularExpression Id. */ - int WHILE = 64; - /** RegularExpression Id. */ - int LONG_LITERAL = 65; - /** RegularExpression Id. */ - int INTEGER_LITERAL = 66; - /** RegularExpression Id. */ - int DECIMAL_LITERAL = 67; - /** RegularExpression Id. */ - int HEX_LITERAL = 68; - /** RegularExpression Id. */ - int OCTAL_LITERAL = 69; - /** RegularExpression Id. */ - int FLOATING_POINT_LITERAL = 70; - /** RegularExpression Id. */ - int DECIMAL_FLOATING_POINT_LITERAL = 71; - /** RegularExpression Id. */ - int DECIMAL_EXPONENT = 72; - /** RegularExpression Id. */ - int HEXADECIMAL_FLOATING_POINT_LITERAL = 73; - /** RegularExpression Id. */ - int HEXADECIMAL_EXPONENT = 74; - /** RegularExpression Id. */ - int CHARACTER_LITERAL = 75; - /** RegularExpression Id. */ - int STRING_LITERAL = 76; - /** RegularExpression Id. */ - int IDENTIFIER = 77; - /** RegularExpression Id. */ - int LETTER = 78; - /** RegularExpression Id. */ - int PART_LETTER = 79; - /** RegularExpression Id. */ - int LPAREN = 80; - /** RegularExpression Id. */ - int RPAREN = 81; - /** RegularExpression Id. */ - int LBRACE = 82; - /** RegularExpression Id. */ - int RBRACE = 83; - /** RegularExpression Id. */ - int LBRACKET = 84; - /** RegularExpression Id. */ - int RBRACKET = 85; - /** RegularExpression Id. */ - int SEMICOLON = 86; - /** RegularExpression Id. */ - int COMMA = 87; - /** RegularExpression Id. */ - int DOT = 88; - /** RegularExpression Id. */ - int AT = 89; - /** RegularExpression Id. */ - int ASSIGN = 90; - /** RegularExpression Id. */ - int LT = 91; - /** RegularExpression Id. */ - int BANG = 92; - /** RegularExpression Id. */ - int TILDE = 93; - /** RegularExpression Id. */ - int HOOK = 94; - /** RegularExpression Id. */ - int COLON = 95; - /** RegularExpression Id. */ - int EQ = 96; - /** RegularExpression Id. */ - int LE = 97; - /** RegularExpression Id. */ - int GE = 98; - /** RegularExpression Id. */ - int NE = 99; - /** RegularExpression Id. */ - int SC_OR = 100; - /** RegularExpression Id. */ - int SC_AND = 101; - /** RegularExpression Id. */ - int INCR = 102; - /** RegularExpression Id. */ - int DECR = 103; - /** RegularExpression Id. */ - int PLUS = 104; - /** RegularExpression Id. */ - int MINUS = 105; - /** RegularExpression Id. */ - int STAR = 106; - /** RegularExpression Id. */ - int SLASH = 107; - /** RegularExpression Id. */ - int BIT_AND = 108; - /** RegularExpression Id. */ - int BIT_OR = 109; - /** RegularExpression Id. */ - int XOR = 110; - /** RegularExpression Id. */ - int REM = 111; - /** RegularExpression Id. */ - int LSHIFT = 112; - /** RegularExpression Id. */ - int PLUSASSIGN = 113; - /** RegularExpression Id. */ - int MINUSASSIGN = 114; - /** RegularExpression Id. */ - int STARASSIGN = 115; - /** RegularExpression Id. */ - int SLASHASSIGN = 116; - /** RegularExpression Id. */ - int ANDASSIGN = 117; - /** RegularExpression Id. */ - int ORASSIGN = 118; - /** RegularExpression Id. */ - int XORASSIGN = 119; - /** RegularExpression Id. */ - int REMASSIGN = 120; - /** RegularExpression Id. */ - int LSHIFTASSIGN = 121; - /** RegularExpression Id. */ - int RSIGNEDSHIFTASSIGN = 122; - /** RegularExpression Id. */ - int RUNSIGNEDSHIFTASSIGN = 123; - /** RegularExpression Id. */ - int ELLIPSIS = 124; - /** RegularExpression Id. */ - int RUNSIGNEDSHIFT = 125; - /** RegularExpression Id. */ - int RSIGNEDSHIFT = 126; - /** RegularExpression Id. */ - int GT = 127; - - /** Lexical state. */ - int DEFAULT = 0; - /** Lexical state. */ - int IN_JAVA_DOC_COMMENT = 1; - /** Lexical state. */ - int IN_MULTI_LINE_COMMENT = 2; - - /** Literal token values. */ - String[] tokenImage = { - "", - "\" \"", - "\"\\t\"", - "\"\\n\"", - "\"\\r\"", - "\"\\f\"", - "", - "", - "\"/*\"", - "\"*/\"", - "\"*/\"", - "", - "\"abstract\"", - "\"assert\"", - "\"boolean\"", - "\"break\"", - "\"byte\"", - "\"case\"", - "\"catch\"", - "\"char\"", - "\"class\"", - "\"const\"", - "\"continue\"", - "\"default\"", - "\"do\"", - "\"double\"", - "\"else\"", - "\"enum\"", - "\"extends\"", - "\"false\"", - "\"final\"", - "\"finally\"", - "\"float\"", - "\"for\"", - "\"goto\"", - "\"if\"", - "\"implements\"", - "\"import\"", - "\"instanceof\"", - "\"int\"", - "\"interface\"", - "\"long\"", - "\"native\"", - "\"new\"", - "\"null\"", - "\"package\"", - "\"private\"", - "\"protected\"", - "\"public\"", - "\"return\"", - "\"short\"", - "\"static\"", - "\"strictfp\"", - "\"super\"", - "\"switch\"", - "\"synchronized\"", - "\"this\"", - "\"throw\"", - "\"throws\"", - "\"transient\"", - "\"true\"", - "\"try\"", - "\"void\"", - "\"volatile\"", - "\"while\"", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "\"(\"", - "\")\"", - "\"{\"", - "\"}\"", - "\"[\"", - "\"]\"", - "\";\"", - "\",\"", - "\".\"", - "\"@\"", - "\"=\"", - "\"<\"", - "\"!\"", - "\"~\"", - "\"?\"", - "\":\"", - "\"==\"", - "\"<=\"", - "\">=\"", - "\"!=\"", - "\"||\"", - "\"&&\"", - "\"++\"", - "\"--\"", - "\"+\"", - "\"-\"", - "\"*\"", - "\"/\"", - "\"&\"", - "\"|\"", - "\"^\"", - "\"%\"", - "\"<<\"", - "\"+=\"", - "\"-=\"", - "\"*=\"", - "\"/=\"", - "\"&=\"", - "\"|=\"", - "\"^=\"", - "\"%=\"", - "\"<<=\"", - "\">>=\"", - "\">>>=\"", - "\"...\"", - "\">>>\"", - "\">>\"", - "\">\"", - "\"\\u001a\"", - }; - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ASTParserTokenManager.java b/stubparser/src/org/checkerframework/stubparser/ASTParserTokenManager.java deleted file mode 100644 index 9fee9e8656d..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ASTParserTokenManager.java +++ /dev/null @@ -1,2530 +0,0 @@ -/* Generated By:JavaCC: Do not edit this line. ASTParserTokenManager.java */ -/* - * Copyright (C) 2008 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -package org.checkerframework.stubparser; - -import java.util.*; - -import org.checkerframework.stubparser.ast.*; -import org.checkerframework.stubparser.ast.body.*; - -/** Token Manager. */ -public class ASTParserTokenManager implements ASTParserConstants -{ - private List comments; - private final Stack javadocStack = new Stack(); - private JavadocComment lastJavadoc; - - void pushJavadoc() { - javadocStack.push(lastJavadoc); - } - - JavadocComment popJavadoc() { - return javadocStack.pop(); - } - - List getComments() { - return comments; - } - - void clearComments() { - comments = null; - javadocStack.clear(); - lastJavadoc = null; - } - - private void CommonTokenAction(Token token) { - lastJavadoc = null; - if (token.specialToken != null) { - if (comments == null) { - comments = new LinkedList(); - } - Token special = token.specialToken; - if (special.kind == JAVA_DOC_COMMENT) { - lastJavadoc = new JavadocComment(special.beginLine, special.beginColumn, special.endLine, special.endColumn, special.image.substring(3, special.image.length()-2)); - comments.add(lastJavadoc); - } else if (special.kind == SINGLE_LINE_COMMENT) { - LineComment comment = new LineComment(special.beginLine, special.beginColumn, special.endLine, special.endColumn, special.image.substring(2)); - comments.add(comment); - } else if (special.kind == MULTI_LINE_COMMENT) { - BlockComment comment = new BlockComment(special.beginLine, special.beginColumn, special.endLine, special.endColumn, special.image.substring(2, special.image.length()-2)); - comments.add(comment); - } - } - } - - /** Debug output. */ - public java.io.PrintStream debugStream = System.out; - /** Set debug output. */ - public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } -private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1, long active2) -{ - switch (pos) - { - case 0: - if ((active0 & 0xfffffffffffff000L) != 0L || (active1 & 0x1L) != 0L) - { - jjmatchedKind = 77; - return 37; - } - if ((active1 & 0x1000000001000000L) != 0L) { - return 1; - } - if ((active0 & 0x100L) != 0L || (active1 & 0x10080000000000L) != 0L) { - return 54; - } - return -1; - case 1: - if ((active0 & 0x100L) != 0L) { - return 59; - } - if ((active0 & 0x803000000L) != 0L) { - return 37; - } - if ((active0 & 0xfffffff7fcfff000L) != 0L || (active1 & 0x1L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 77; - jjmatchedPos = 1; - } - return 37; - } - return -1; - case 2: - if ((active0 & 0xdffff675fefff000L) != 0L || (active1 & 0x1L) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 77; - jjmatchedPos = 2; - } - return 37; - } - if ((active0 & 0x2000098200000000L) != 0L) { - return 37; - } - return -1; - case 3: - if ((active0 & 0x8effe571f2f4f000L) != 0L || (active1 & 0x1L) != 0L) - { - jjmatchedKind = 77; - jjmatchedPos = 3; - return 37; - } - if ((active0 & 0x510012040c0b0000L) != 0L) { - return 37; - } - return -1; - case 4: - if ((active0 & 0x88dbe57012c07000L) != 0L) - { - if (jjmatchedPos != 4) - { - jjmatchedKind = 77; - jjmatchedPos = 4; - } - return 37; - } - if ((active0 & 0x6240001e0348000L) != 0L || (active1 & 0x1L) != 0L) { - return 37; - } - return -1; - case 5: - if ((active0 & 0x8890e15090c05000L) != 0L) - { - jjmatchedKind = 77; - jjmatchedPos = 5; - return 37; - } - if ((active0 & 0x44b042002002000L) != 0L) { - return 37; - } - return -1; - case 6: - if ((active0 & 0x8890815000401000L) != 0L) - { - jjmatchedKind = 77; - jjmatchedPos = 6; - return 37; - } - if ((active0 & 0x600090804000L) != 0L) { - return 37; - } - return -1; - case 7: - if ((active0 & 0x880815000000000L) != 0L) - { - jjmatchedKind = 77; - jjmatchedPos = 7; - return 37; - } - if ((active0 & 0x8010000000401000L) != 0L) { - return 37; - } - return -1; - case 8: - if ((active0 & 0x800810000000000L) != 0L) { - return 37; - } - if ((active0 & 0x80005000000000L) != 0L) - { - jjmatchedKind = 77; - jjmatchedPos = 8; - return 37; - } - return -1; - case 9: - if ((active0 & 0x80000000000000L) != 0L) - { - jjmatchedKind = 77; - jjmatchedPos = 9; - return 37; - } - if ((active0 & 0x5000000000L) != 0L) { - return 37; - } - return -1; - case 10: - if ((active0 & 0x80000000000000L) != 0L) - { - jjmatchedKind = 77; - jjmatchedPos = 10; - return 37; - } - return -1; - default : - return -1; - } -} -private final int jjStartNfa_0(int pos, long active0, long active1, long active2) -{ - return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1, active2), pos + 1); -} -private int jjStopAtPos(int pos, int kind) -{ - jjmatchedKind = kind; - jjmatchedPos = pos; - return pos + 1; -} -private int jjMoveStringLiteralDfa0_0() -{ - switch(curChar) - { - case 26: - return jjStopAtPos(0, 128); - case 33: - jjmatchedKind = 92; - return jjMoveStringLiteralDfa1_0(0x0L, 0x800000000L); - case 37: - jjmatchedKind = 111; - return jjMoveStringLiteralDfa1_0(0x0L, 0x100000000000000L); - case 38: - jjmatchedKind = 108; - return jjMoveStringLiteralDfa1_0(0x0L, 0x20002000000000L); - case 40: - return jjStopAtPos(0, 80); - case 41: - return jjStopAtPos(0, 81); - case 42: - jjmatchedKind = 106; - return jjMoveStringLiteralDfa1_0(0x0L, 0x8000000000000L); - case 43: - jjmatchedKind = 104; - return jjMoveStringLiteralDfa1_0(0x0L, 0x2004000000000L); - case 44: - return jjStopAtPos(0, 87); - case 45: - jjmatchedKind = 105; - return jjMoveStringLiteralDfa1_0(0x0L, 0x4008000000000L); - case 46: - jjmatchedKind = 88; - return jjMoveStringLiteralDfa1_0(0x0L, 0x1000000000000000L); - case 47: - jjmatchedKind = 107; - return jjMoveStringLiteralDfa1_0(0x100L, 0x10000000000000L); - case 58: - return jjStopAtPos(0, 95); - case 59: - return jjStopAtPos(0, 86); - case 60: - jjmatchedKind = 91; - return jjMoveStringLiteralDfa1_0(0x0L, 0x201000200000000L); - case 61: - jjmatchedKind = 90; - return jjMoveStringLiteralDfa1_0(0x0L, 0x100000000L); - case 62: - jjmatchedKind = 127; - return jjMoveStringLiteralDfa1_0(0x0L, 0x6c00000400000000L); - case 63: - return jjStopAtPos(0, 94); - case 64: - return jjStopAtPos(0, 89); - case 91: - return jjStopAtPos(0, 84); - case 93: - return jjStopAtPos(0, 85); - case 94: - jjmatchedKind = 110; - return jjMoveStringLiteralDfa1_0(0x0L, 0x80000000000000L); - case 97: - return jjMoveStringLiteralDfa1_0(0x3000L, 0x0L); - case 98: - return jjMoveStringLiteralDfa1_0(0x1c000L, 0x0L); - case 99: - return jjMoveStringLiteralDfa1_0(0x7e0000L, 0x0L); - case 100: - return jjMoveStringLiteralDfa1_0(0x3800000L, 0x0L); - case 101: - return jjMoveStringLiteralDfa1_0(0x1c000000L, 0x0L); - case 102: - return jjMoveStringLiteralDfa1_0(0x3e0000000L, 0x0L); - case 103: - return jjMoveStringLiteralDfa1_0(0x400000000L, 0x0L); - case 105: - return jjMoveStringLiteralDfa1_0(0x1f800000000L, 0x0L); - case 108: - return jjMoveStringLiteralDfa1_0(0x20000000000L, 0x0L); - case 110: - return jjMoveStringLiteralDfa1_0(0x1c0000000000L, 0x0L); - case 112: - return jjMoveStringLiteralDfa1_0(0x1e00000000000L, 0x0L); - case 114: - return jjMoveStringLiteralDfa1_0(0x2000000000000L, 0x0L); - case 115: - return jjMoveStringLiteralDfa1_0(0xfc000000000000L, 0x0L); - case 116: - return jjMoveStringLiteralDfa1_0(0x3f00000000000000L, 0x0L); - case 118: - return jjMoveStringLiteralDfa1_0(0xc000000000000000L, 0x0L); - case 119: - return jjMoveStringLiteralDfa1_0(0x0L, 0x1L); - case 123: - return jjStopAtPos(0, 82); - case 124: - jjmatchedKind = 109; - return jjMoveStringLiteralDfa1_0(0x0L, 0x40001000000000L); - case 125: - return jjStopAtPos(0, 83); - case 126: - return jjStopAtPos(0, 93); - default : - return jjMoveNfa_0(0, 0); - } -} -private int jjMoveStringLiteralDfa1_0(long active0, long active1) -{ - try { curChar = input_stream.readChar(); } - catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(0, active0, active1, 0L); - return 1; - } - switch(curChar) - { - case 38: - if ((active1 & 0x2000000000L) != 0L) { - return jjStopAtPos(1, 101); - } - break; - case 42: - if ((active0 & 0x100L) != 0L) { - return jjStartNfaWithStates_0(1, 8, 59); - } - break; - case 43: - if ((active1 & 0x4000000000L) != 0L) { - return jjStopAtPos(1, 102); - } - break; - case 45: - if ((active1 & 0x8000000000L) != 0L) { - return jjStopAtPos(1, 103); - } - break; - case 46: - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x1000000000000000L); - case 60: - if ((active1 & 0x1000000000000L) != 0L) - { - jjmatchedKind = 112; - jjmatchedPos = 1; - } - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x200000000000000L); - case 61: - if ((active1 & 0x100000000L) != 0L) { - return jjStopAtPos(1, 96); - } else if ((active1 & 0x200000000L) != 0L) - return jjStopAtPos(1, 97); - else if ((active1 & 0x400000000L) != 0L) - return jjStopAtPos(1, 98); - else if ((active1 & 0x800000000L) != 0L) - return jjStopAtPos(1, 99); - else if ((active1 & 0x2000000000000L) != 0L) - return jjStopAtPos(1, 113); - else if ((active1 & 0x4000000000000L) != 0L) - return jjStopAtPos(1, 114); - else if ((active1 & 0x8000000000000L) != 0L) - return jjStopAtPos(1, 115); - else if ((active1 & 0x10000000000000L) != 0L) - return jjStopAtPos(1, 116); - else if ((active1 & 0x20000000000000L) != 0L) - return jjStopAtPos(1, 117); - else if ((active1 & 0x40000000000000L) != 0L) - return jjStopAtPos(1, 118); - else if ((active1 & 0x80000000000000L) != 0L) - return jjStopAtPos(1, 119); - else if ((active1 & 0x100000000000000L) != 0L) - return jjStopAtPos(1, 120); - break; - case 62: - if ((active1 & 0x4000000000000000L) != 0L) - { - jjmatchedKind = 126; - jjmatchedPos = 1; - } - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x2c00000000000000L); - case 97: - return jjMoveStringLiteralDfa2_0(active0, 0x240020060000L, active1, 0L); - case 98: - return jjMoveStringLiteralDfa2_0(active0, 0x1000L, active1, 0L); - case 101: - return jjMoveStringLiteralDfa2_0(active0, 0x2080000800000L, active1, 0L); - case 102: - if ((active0 & 0x800000000L) != 0L) { - return jjStartNfaWithStates_0(1, 35, 37); - } - break; - case 104: - return jjMoveStringLiteralDfa2_0(active0, 0x704000000080000L, active1, 0x1L); - case 105: - return jjMoveStringLiteralDfa2_0(active0, 0xc0000000L, active1, 0L); - case 108: - return jjMoveStringLiteralDfa2_0(active0, 0x104100000L, active1, 0L); - case 109: - return jjMoveStringLiteralDfa2_0(active0, 0x3000000000L, active1, 0L); - case 110: - return jjMoveStringLiteralDfa2_0(active0, 0x1c008000000L, active1, 0L); - case 111: - if ((active0 & 0x1000000L) != 0L) - { - jjmatchedKind = 24; - jjmatchedPos = 1; - } - return jjMoveStringLiteralDfa2_0(active0, 0xc000020602604000L, active1, 0L); - case 114: - return jjMoveStringLiteralDfa2_0(active0, 0x3800c00000008000L, active1, 0L); - case 115: - return jjMoveStringLiteralDfa2_0(active0, 0x2000L, active1, 0L); - case 116: - return jjMoveStringLiteralDfa2_0(active0, 0x18000000000000L, active1, 0L); - case 117: - return jjMoveStringLiteralDfa2_0(active0, 0x21100000000000L, active1, 0L); - case 119: - return jjMoveStringLiteralDfa2_0(active0, 0x40000000000000L, active1, 0L); - case 120: - return jjMoveStringLiteralDfa2_0(active0, 0x10000000L, active1, 0L); - case 121: - return jjMoveStringLiteralDfa2_0(active0, 0x80000000010000L, active1, 0L); - case 124: - if ((active1 & 0x1000000000L) != 0L) { - return jjStopAtPos(1, 100); - } - break; - default : - break; - } - return jjStartNfa_0(0, active0, active1, 0L); -} -private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1) -{ - if (((active0 &= old0) | (active1 &= old1)) == 0L) { - return jjStartNfa_0(0, old0, old1, 0L); - } - try { curChar = input_stream.readChar(); } - catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(1, active0, active1, 0L); - return 2; - } - switch(curChar) - { - case 46: - if ((active1 & 0x1000000000000000L) != 0L) { - return jjStopAtPos(2, 124); - } - break; - case 61: - if ((active1 & 0x200000000000000L) != 0L) { - return jjStopAtPos(2, 121); - } else if ((active1 & 0x400000000000000L) != 0L) - return jjStopAtPos(2, 122); - break; - case 62: - if ((active1 & 0x2000000000000000L) != 0L) - { - jjmatchedKind = 125; - jjmatchedPos = 2; - } - return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x800000000000000L); - case 97: - return jjMoveStringLiteralDfa3_0(active0, 0x808000000180000L, active1, 0L); - case 98: - return jjMoveStringLiteralDfa3_0(active0, 0x1000000000000L, active1, 0L); - case 99: - return jjMoveStringLiteralDfa3_0(active0, 0x200000000000L, active1, 0L); - case 101: - return jjMoveStringLiteralDfa3_0(active0, 0x8000L, active1, 0L); - case 102: - return jjMoveStringLiteralDfa3_0(active0, 0x800000L, active1, 0L); - case 105: - return jjMoveStringLiteralDfa3_0(active0, 0x4140400000000000L, active1, 0x1L); - case 108: - return jjMoveStringLiteralDfa3_0(active0, 0x8000100020000000L, active1, 0L); - case 110: - return jjMoveStringLiteralDfa3_0(active0, 0x800200c0600000L, active1, 0L); - case 111: - return jjMoveStringLiteralDfa3_0(active0, 0x4800100004000L, active1, 0L); - case 112: - return jjMoveStringLiteralDfa3_0(active0, 0x20003000000000L, active1, 0L); - case 114: - if ((active0 & 0x200000000L) != 0L) { - return jjStartNfaWithStates_0(2, 33, 37); - } - return jjMoveStringLiteralDfa3_0(active0, 0x610000000000000L, active1, 0L); - case 115: - return jjMoveStringLiteralDfa3_0(active0, 0x4004023000L, active1, 0L); - case 116: - if ((active0 & 0x8000000000L) != 0L) - { - jjmatchedKind = 39; - jjmatchedPos = 2; - } - return jjMoveStringLiteralDfa3_0(active0, 0x2050410050000L, active1, 0L); - case 117: - return jjMoveStringLiteralDfa3_0(active0, 0x100000000a000000L, active1, 0L); - case 119: - if ((active0 & 0x80000000000L) != 0L) { - return jjStartNfaWithStates_0(2, 43, 37); - } - break; - case 121: - if ((active0 & 0x2000000000000000L) != 0L) { - return jjStartNfaWithStates_0(2, 61, 37); - } - break; - default : - break; - } - return jjStartNfa_0(1, active0, active1, 0L); -} -private int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long active1) -{ - if (((active0 &= old0) | (active1 &= old1)) == 0L) { - return jjStartNfa_0(1, old0, old1, 0L); - } - try { curChar = input_stream.readChar(); } - catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(2, active0, active1, 0L); - return 3; - } - switch(curChar) - { - case 61: - if ((active1 & 0x800000000000000L) != 0L) { - return jjStopAtPos(3, 123); - } - break; - case 97: - return jjMoveStringLiteralDfa4_0(active0, 0x80000001c0808000L, active1, 0L); - case 98: - return jjMoveStringLiteralDfa4_0(active0, 0x2000000L, active1, 0L); - case 99: - return jjMoveStringLiteralDfa4_0(active0, 0x80000000040000L, active1, 0L); - case 100: - if ((active0 & 0x4000000000000000L) != 0L) { - return jjStartNfaWithStates_0(3, 62, 37); - } - break; - case 101: - if ((active0 & 0x10000L) != 0L) { - return jjStartNfaWithStates_0(3, 16, 37); - } else if ((active0 & 0x20000L) != 0L) - return jjStartNfaWithStates_0(3, 17, 37); - else if ((active0 & 0x4000000L) != 0L) - return jjStartNfaWithStates_0(3, 26, 37); - else if ((active0 & 0x1000000000000000L) != 0L) - return jjStartNfaWithStates_0(3, 60, 37); - return jjMoveStringLiteralDfa4_0(active0, 0x20010010002000L, active1, 0L); - case 103: - if ((active0 & 0x20000000000L) != 0L) { - return jjStartNfaWithStates_0(3, 41, 37); - } - break; - case 105: - return jjMoveStringLiteralDfa4_0(active0, 0x10040000000000L, active1, 0L); - case 107: - return jjMoveStringLiteralDfa4_0(active0, 0x200000000000L, active1, 0L); - case 108: - if ((active0 & 0x100000000000L) != 0L) { - return jjStartNfaWithStates_0(3, 44, 37); - } - return jjMoveStringLiteralDfa4_0(active0, 0x1001000004000L, active1, 0x1L); - case 109: - if ((active0 & 0x8000000L) != 0L) { - return jjStartNfaWithStates_0(3, 27, 37); - } - break; - case 110: - return jjMoveStringLiteralDfa4_0(active0, 0x800000000000000L, active1, 0L); - case 111: - if ((active0 & 0x400000000L) != 0L) { - return jjStartNfaWithStates_0(3, 34, 37); - } - return jjMoveStringLiteralDfa4_0(active0, 0x600002000000000L, active1, 0L); - case 114: - if ((active0 & 0x80000L) != 0L) { - return jjStartNfaWithStates_0(3, 19, 37); - } - return jjMoveStringLiteralDfa4_0(active0, 0x4000000000000L, active1, 0L); - case 115: - if ((active0 & 0x100000000000000L) != 0L) { - return jjStartNfaWithStates_0(3, 56, 37); - } - return jjMoveStringLiteralDfa4_0(active0, 0x20300000L, active1, 0L); - case 116: - return jjMoveStringLiteralDfa4_0(active0, 0x48804000401000L, active1, 0L); - case 117: - return jjMoveStringLiteralDfa4_0(active0, 0x2000000000000L, active1, 0L); - case 118: - return jjMoveStringLiteralDfa4_0(active0, 0x400000000000L, active1, 0L); - default : - break; - } - return jjStartNfa_0(2, active0, active1, 0L); -} -private int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, long active1) -{ - if (((active0 &= old0) | (active1 &= old1)) == 0L) { - return jjStartNfa_0(2, old0, old1, 0L); - } - try { curChar = input_stream.readChar(); } - catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(3, active0, active1, 0L); - return 4; - } - switch(curChar) - { - case 97: - return jjMoveStringLiteralDfa5_0(active0, 0x604000000000L, active1, 0L); - case 99: - return jjMoveStringLiteralDfa5_0(active0, 0x50000000000000L, active1, 0L); - case 101: - if ((active0 & 0x20000000L) != 0L) { - return jjStartNfaWithStates_0(4, 29, 37); - } else if ((active1 & 0x1L) != 0L) - return jjStartNfaWithStates_0(4, 64, 37); - return jjMoveStringLiteralDfa5_0(active0, 0x801000004000L, active1, 0L); - case 104: - if ((active0 & 0x40000L) != 0L) { - return jjStartNfaWithStates_0(4, 18, 37); - } - return jjMoveStringLiteralDfa5_0(active0, 0x80000000000000L, active1, 0L); - case 105: - return jjMoveStringLiteralDfa5_0(active0, 0x9000000400000L, active1, 0L); - case 107: - if ((active0 & 0x8000L) != 0L) { - return jjStartNfaWithStates_0(4, 15, 37); - } - break; - case 108: - if ((active0 & 0x40000000L) != 0L) - { - jjmatchedKind = 30; - jjmatchedPos = 4; - } - return jjMoveStringLiteralDfa5_0(active0, 0x82000000L, active1, 0L); - case 110: - return jjMoveStringLiteralDfa5_0(active0, 0x10000000L, active1, 0L); - case 114: - if ((active0 & 0x20000000000000L) != 0L) { - return jjStartNfaWithStates_0(4, 53, 37); - } - return jjMoveStringLiteralDfa5_0(active0, 0x2012000003000L, active1, 0L); - case 115: - if ((active0 & 0x100000L) != 0L) { - return jjStartNfaWithStates_0(4, 20, 37); - } - return jjMoveStringLiteralDfa5_0(active0, 0x800000000000000L, active1, 0L); - case 116: - if ((active0 & 0x200000L) != 0L) { - return jjStartNfaWithStates_0(4, 21, 37); - } else if ((active0 & 0x100000000L) != 0L) - return jjStartNfaWithStates_0(4, 32, 37); - else if ((active0 & 0x4000000000000L) != 0L) - return jjStartNfaWithStates_0(4, 50, 37); - return jjMoveStringLiteralDfa5_0(active0, 0x8000000000000000L, active1, 0L); - case 117: - return jjMoveStringLiteralDfa5_0(active0, 0x800000L, active1, 0L); - case 118: - return jjMoveStringLiteralDfa5_0(active0, 0x40000000000L, active1, 0L); - case 119: - if ((active0 & 0x200000000000000L) != 0L) - { - jjmatchedKind = 57; - jjmatchedPos = 4; - } - return jjMoveStringLiteralDfa5_0(active0, 0x400000000000000L, active1, 0L); - default : - break; - } - return jjStartNfa_0(3, active0, active1, 0L); -} -private int jjMoveStringLiteralDfa5_0(long old0, long active0, long old1, long active1) -{ - if (((active0 &= old0) | (active1 &= old1)) == 0L) { - return jjStartNfa_0(3, old0, old1, 0L); - } - try { curChar = input_stream.readChar(); } - catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(4, active0, 0L, 0L); - return 5; - } - switch(curChar) - { - case 97: - return jjMoveStringLiteralDfa6_0(active0, 0x5000L); - case 99: - if ((active0 & 0x1000000000000L) != 0L) { - return jjStartNfaWithStates_0(5, 48, 37); - } else if ((active0 & 0x8000000000000L) != 0L) - return jjStartNfaWithStates_0(5, 51, 37); - return jjMoveStringLiteralDfa6_0(active0, 0x800000000000L); - case 100: - return jjMoveStringLiteralDfa6_0(active0, 0x10000000L); - case 101: - if ((active0 & 0x2000000L) != 0L) { - return jjStartNfaWithStates_0(5, 25, 37); - } else if ((active0 & 0x40000000000L) != 0L) - return jjStartNfaWithStates_0(5, 42, 37); - break; - case 102: - return jjMoveStringLiteralDfa6_0(active0, 0x10000000000L); - case 103: - return jjMoveStringLiteralDfa6_0(active0, 0x200000000000L); - case 104: - if ((active0 & 0x40000000000000L) != 0L) { - return jjStartNfaWithStates_0(5, 54, 37); - } - break; - case 105: - return jjMoveStringLiteralDfa6_0(active0, 0x8800000000000000L); - case 108: - return jjMoveStringLiteralDfa6_0(active0, 0x80800000L); - case 109: - return jjMoveStringLiteralDfa6_0(active0, 0x1000000000L); - case 110: - if ((active0 & 0x2000000000000L) != 0L) { - return jjStartNfaWithStates_0(5, 49, 37); - } - return jjMoveStringLiteralDfa6_0(active0, 0x4000400000L); - case 114: - return jjMoveStringLiteralDfa6_0(active0, 0x80000000000000L); - case 115: - if ((active0 & 0x400000000000000L) != 0L) { - return jjStartNfaWithStates_0(5, 58, 37); - } - break; - case 116: - if ((active0 & 0x2000L) != 0L) { - return jjStartNfaWithStates_0(5, 13, 37); - } else if ((active0 & 0x2000000000L) != 0L) - return jjStartNfaWithStates_0(5, 37, 37); - return jjMoveStringLiteralDfa6_0(active0, 0x10400000000000L); - default : - break; - } - return jjStartNfa_0(4, active0, 0L, 0L); -} -private int jjMoveStringLiteralDfa6_0(long old0, long active0) -{ - if (((active0 &= old0)) == 0L) { - return jjStartNfa_0(4, old0, 0L, 0L); - } - try { curChar = input_stream.readChar(); } - catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(5, active0, 0L, 0L); - return 6; - } - switch(curChar) - { - case 97: - return jjMoveStringLiteralDfa7_0(active0, 0x10000000000L); - case 99: - return jjMoveStringLiteralDfa7_0(active0, 0x4000001000L); - case 101: - if ((active0 & 0x200000000000L) != 0L) { - return jjStartNfaWithStates_0(6, 45, 37); - } else if ((active0 & 0x400000000000L) != 0L) - return jjStartNfaWithStates_0(6, 46, 37); - return jjMoveStringLiteralDfa7_0(active0, 0x800001000000000L); - case 102: - return jjMoveStringLiteralDfa7_0(active0, 0x10000000000000L); - case 108: - return jjMoveStringLiteralDfa7_0(active0, 0x8000000000000000L); - case 110: - if ((active0 & 0x4000L) != 0L) { - return jjStartNfaWithStates_0(6, 14, 37); - } - break; - case 111: - return jjMoveStringLiteralDfa7_0(active0, 0x80000000000000L); - case 115: - if ((active0 & 0x10000000L) != 0L) { - return jjStartNfaWithStates_0(6, 28, 37); - } - break; - case 116: - if ((active0 & 0x800000L) != 0L) { - return jjStartNfaWithStates_0(6, 23, 37); - } - return jjMoveStringLiteralDfa7_0(active0, 0x800000000000L); - case 117: - return jjMoveStringLiteralDfa7_0(active0, 0x400000L); - case 121: - if ((active0 & 0x80000000L) != 0L) { - return jjStartNfaWithStates_0(6, 31, 37); - } - break; - default : - break; - } - return jjStartNfa_0(5, active0, 0L, 0L); -} -private int jjMoveStringLiteralDfa7_0(long old0, long active0) -{ - if (((active0 &= old0)) == 0L) { - return jjStartNfa_0(5, old0, 0L, 0L); - } - try { curChar = input_stream.readChar(); } - catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(6, active0, 0L, 0L); - return 7; - } - switch(curChar) - { - case 99: - return jjMoveStringLiteralDfa8_0(active0, 0x10000000000L); - case 101: - if ((active0 & 0x400000L) != 0L) { - return jjStartNfaWithStates_0(7, 22, 37); - } else if ((active0 & 0x8000000000000000L) != 0L) - return jjStartNfaWithStates_0(7, 63, 37); - return jjMoveStringLiteralDfa8_0(active0, 0x804000000000L); - case 110: - return jjMoveStringLiteralDfa8_0(active0, 0x880001000000000L); - case 112: - if ((active0 & 0x10000000000000L) != 0L) { - return jjStartNfaWithStates_0(7, 52, 37); - } - break; - case 116: - if ((active0 & 0x1000L) != 0L) { - return jjStartNfaWithStates_0(7, 12, 37); - } - break; - default : - break; - } - return jjStartNfa_0(6, active0, 0L, 0L); -} -private int jjMoveStringLiteralDfa8_0(long old0, long active0) -{ - if (((active0 &= old0)) == 0L) { - return jjStartNfa_0(6, old0, 0L, 0L); - } - try { curChar = input_stream.readChar(); } - catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(7, active0, 0L, 0L); - return 8; - } - switch(curChar) - { - case 100: - if ((active0 & 0x800000000000L) != 0L) { - return jjStartNfaWithStates_0(8, 47, 37); - } - break; - case 101: - if ((active0 & 0x10000000000L) != 0L) { - return jjStartNfaWithStates_0(8, 40, 37); - } - break; - case 105: - return jjMoveStringLiteralDfa9_0(active0, 0x80000000000000L); - case 111: - return jjMoveStringLiteralDfa9_0(active0, 0x4000000000L); - case 116: - if ((active0 & 0x800000000000000L) != 0L) { - return jjStartNfaWithStates_0(8, 59, 37); - } - return jjMoveStringLiteralDfa9_0(active0, 0x1000000000L); - default : - break; - } - return jjStartNfa_0(7, active0, 0L, 0L); -} -private int jjMoveStringLiteralDfa9_0(long old0, long active0) -{ - if (((active0 &= old0)) == 0L) { - return jjStartNfa_0(7, old0, 0L, 0L); - } - try { curChar = input_stream.readChar(); } - catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(8, active0, 0L, 0L); - return 9; - } - switch(curChar) - { - case 102: - if ((active0 & 0x4000000000L) != 0L) { - return jjStartNfaWithStates_0(9, 38, 37); - } - break; - case 115: - if ((active0 & 0x1000000000L) != 0L) { - return jjStartNfaWithStates_0(9, 36, 37); - } - break; - case 122: - return jjMoveStringLiteralDfa10_0(active0, 0x80000000000000L); - default : - break; - } - return jjStartNfa_0(8, active0, 0L, 0L); -} -private int jjMoveStringLiteralDfa10_0(long old0, long active0) -{ - if (((active0 &= old0)) == 0L) { - return jjStartNfa_0(8, old0, 0L, 0L); - } - try { curChar = input_stream.readChar(); } - catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(9, active0, 0L, 0L); - return 10; - } - switch(curChar) - { - case 101: - return jjMoveStringLiteralDfa11_0(active0, 0x80000000000000L); - default : - break; - } - return jjStartNfa_0(9, active0, 0L, 0L); -} -private int jjMoveStringLiteralDfa11_0(long old0, long active0) -{ - if (((active0 &= old0)) == 0L) { - return jjStartNfa_0(9, old0, 0L, 0L); - } - try { curChar = input_stream.readChar(); } - catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(10, active0, 0L, 0L); - return 11; - } - switch(curChar) - { - case 100: - if ((active0 & 0x80000000000000L) != 0L) { - return jjStartNfaWithStates_0(11, 55, 37); - } - break; - default : - break; - } - return jjStartNfa_0(10, active0, 0L, 0L); -} -private int jjStartNfaWithStates_0(int pos, int kind, int state) -{ - jjmatchedKind = kind; - jjmatchedPos = pos; - try { curChar = input_stream.readChar(); } - catch (java.io.IOException e) { return pos + 1; } - return jjMoveNfa_0(state, pos + 1); -} -static final long[] jjbitVec0 = { - 0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL -}; -static final long[] jjbitVec2 = { - 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL -}; -static final long[] jjbitVec3 = { - 0xfff0000000200002L, 0xffffffffffffdfffL, 0xfffff00f7fffffffL, 0x12000000007fffffL -}; -static final long[] jjbitVec4 = { - 0x0L, 0x0L, 0x420043c00000000L, 0xff7fffffff7fffffL -}; -static final long[] jjbitVec5 = { - 0x7fffffffffffffL, 0xffffffffffff0000L, 0xffffffffffffffffL, 0x401f0003ffc3L -}; -static final long[] jjbitVec6 = { - 0x0L, 0x400000000000000L, 0xfffffffbffffd740L, 0xfbfffffffff7fffL -}; -static final long[] jjbitVec7 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0xfffffffffffffc03L, 0x33fffffffff7fffL -}; -static final long[] jjbitVec8 = { - 0xfffe00000000ffffL, 0xfffffffe027fffffL, 0xffL, 0x707ffffff0000L -}; -static final long[] jjbitVec9 = { - 0x7fffffe00000000L, 0xfffec000000007ffL, 0xffffffffffffffffL, 0x9c00c060002fffffL -}; -static final long[] jjbitVec10 = { - 0xfffffffd0000L, 0xe000L, 0x2003fffffffffL, 0x0L -}; -static final long[] jjbitVec11 = { - 0x23fffffffffffff0L, 0x3ff010000L, 0x23c5fdfffff99fe0L, 0xf0003b0000000L -}; -static final long[] jjbitVec12 = { - 0x36dfdfffff987e0L, 0x1c00005e000000L, 0x23edfdfffffbbfe0L, 0x2000300010000L -}; -static final long[] jjbitVec13 = { - 0x23edfdfffff99fe0L, 0x20003b0000000L, 0x3bfc718d63dc7e8L, 0x200000000000000L -}; -static final long[] jjbitVec14 = { - 0x3effdfffffddfe0L, 0x300000000L, 0x23effdfffffddfe0L, 0x340000000L -}; -static final long[] jjbitVec15 = { - 0x3fffdfffffddfe0L, 0x300000000L, 0x2ffbfffffc7fffe0L, 0x7fL -}; -static final long[] jjbitVec16 = { - 0x800dfffffffffffeL, 0x7fL, 0x200decaefef02596L, 0x3000005fL -}; -static final long[] jjbitVec17 = { - 0x1L, 0x7fffffffeffL, 0xf00L, 0x0L -}; -static final long[] jjbitVec18 = { - 0x6fbffffffffL, 0x3f0000L, 0xffffffff00000000L, 0x1ffffffffff003fL -}; -static final long[] jjbitVec19 = { - 0xffffffffffffffffL, 0xffffffff83ffffffL, 0xffffff07ffffffffL, 0x3ffffffffffffffL -}; -static final long[] jjbitVec20 = { - 0xffffffffffffff7fL, 0xffffffff3d7f3d7fL, 0x7f3d7fffffff3d7fL, 0xffff7fffff7f7f3dL -}; -static final long[] jjbitVec21 = { - 0xffffffff7f3d7fffL, 0x7ffff7fL, 0xffffffff00000000L, 0x1fffffffffffffL -}; -static final long[] jjbitVec22 = { - 0xffffffffffffffffL, 0x7f9fffffffffffL, 0xffffffff07fffffeL, 0x1c7ffffffffffL -}; -static final long[] jjbitVec23 = { - 0x3ffff0003dfffL, 0x1dfff0003ffffL, 0xfffffffffffffL, 0x18800000L -}; -static final long[] jjbitVec24 = { - 0xffffffff00000000L, 0xffffffffffffffL, 0x1ffffffffffL, 0x0L -}; -static final long[] jjbitVec25 = { - 0x1fffffffL, 0x1f3fffffff0000L, 0x0L, 0x0L -}; -static final long[] jjbitVec26 = { - 0xffffffffffffffffL, 0xfffffffffffL, 0x0L, 0x0L -}; -static final long[] jjbitVec27 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffff0fffffffL, 0x3ffffffffffffffL -}; -static final long[] jjbitVec28 = { - 0xffffffff3f3fffffL, 0x3fffffffaaff3f3fL, 0x5fdfffffffffffffL, 0x1fdc1fff0fcf1fdcL -}; -static final long[] jjbitVec29 = { - 0x8000000000000000L, 0x8002000000100001L, 0x3ffff00000000L, 0x0L -}; -static final long[] jjbitVec30 = { - 0xe3fbbd503e2ffc84L, 0xffffffff000003e0L, 0xfL, 0x0L -}; -static final long[] jjbitVec31 = { - 0x1f3e03fe000000e0L, 0xfffffffffffffffeL, 0xfffffffee07fffffL, 0xffffffffffffffffL -}; -static final long[] jjbitVec32 = { - 0xfffe1fffffffffe0L, 0xffffffffffffffffL, 0xffffff00007fffL, 0xffff000000000000L -}; -static final long[] jjbitVec33 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0x3fffffffffffffL, 0x0L -}; -static final long[] jjbitVec34 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0x3fffffffffL, 0x0L -}; -static final long[] jjbitVec35 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0x1fffL, 0x0L -}; -static final long[] jjbitVec36 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0xfffffffffL, 0x0L -}; -static final long[] jjbitVec37 = { - 0x6L, 0x0L, 0x0L, 0x0L -}; -static final long[] jjbitVec38 = { - 0xffff3fffffffffffL, 0x7ffffffffffL, 0x0L, 0x0L -}; -static final long[] jjbitVec39 = { - 0x5f7ffdffa0f8007fL, 0xffffffffffffffdbL, 0x3ffffffffffffL, 0xfffffffffff80000L -}; -static final long[] jjbitVec40 = { - 0x3fffffffffffffffL, 0xffffffffffff0000L, 0xfffffffffffcffffL, 0x1fff0000000000ffL -}; -static final long[] jjbitVec41 = { - 0x18000000000000L, 0xffdf02000000e000L, 0xffffffffffffffffL, 0x1fffffffffffffffL -}; -static final long[] jjbitVec42 = { - 0x87fffffe00000010L, 0xffffffe007fffffeL, 0x7fffffffffffffffL, 0x631cfcfcfcL -}; -static final long[] jjbitVec43 = { - 0x0L, 0x0L, 0x420243cffffffffL, 0xff7fffffff7fffffL -}; -static final long[] jjbitVec44 = { - 0xffffffffffffffffL, 0x400ffffe0ffffffL, 0xfffffffbffffd740L, 0xfbfffffffff7fffL -}; -static final long[] jjbitVec45 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0xfffffffffffffc7bL, 0x33fffffffff7fffL -}; -static final long[] jjbitVec46 = { - 0xfffe00000000ffffL, 0xfffffffe027fffffL, 0xbbfffffbfffe00ffL, 0x707ffffff0016L -}; -static final long[] jjbitVec47 = { - 0x7fffffe003f000fL, 0xffffc3ff01ffffffL, 0xffffffffffffffffL, 0x9ffffdffbfefffffL -}; -static final long[] jjbitVec48 = { - 0xffffffffffff8000L, 0xe7ffL, 0x3ffffffffffffL, 0x0L -}; -static final long[] jjbitVec49 = { - 0xf3fffffffffffffeL, 0xffcfff1f3fffL, 0xf3c5fdfffff99feeL, 0xfffcfb080399fL -}; -static final long[] jjbitVec50 = { - 0xd36dfdfffff987eeL, 0x1fffc05e003987L, 0xf3edfdfffffbbfeeL, 0x2ffcf00013bbfL -}; -static final long[] jjbitVec51 = { - 0xf3edfdfffff99feeL, 0x2ffc3b0c0398fL, 0xc3bfc718d63dc7ecL, 0x200ff8000803dc7L -}; -static final long[] jjbitVec52 = { - 0xc3effdfffffddfeeL, 0xffc300603ddfL, 0xf3effdfffffddfecL, 0xffc340603ddfL -}; -static final long[] jjbitVec53 = { - 0xc3fffdfffffddfecL, 0xffc300803dcfL, 0x2ffbfffffc7fffecL, 0xc0000ff5f847fL -}; -static final long[] jjbitVec54 = { - 0x87fffffffffffffeL, 0x3ff7fffL, 0x3bffecaefef02596L, 0x33ff3f5fL -}; -static final long[] jjbitVec55 = { - 0xc2a003ff03000001L, 0xfffe07fffffffeffL, 0x1ffffffffeff0fdfL, 0x40L -}; -static final long[] jjbitVec56 = { - 0x3c7f6fbffffffffL, 0x3ff03ffL, 0xffffffff00000000L, 0x1ffffffffff003fL -}; -static final long[] jjbitVec57 = { - 0xffffffff7f3d7fffL, 0x3fe0007ffff7fL, 0xffffffff00000000L, 0x1fffffffffffffL -}; -static final long[] jjbitVec58 = { - 0x1fffff001fdfffL, 0xddfff000fffffL, 0xffffffffffffffffL, 0x3ff388fffffL -}; -static final long[] jjbitVec59 = { - 0xffffffff03ff3800L, 0xffffffffffffffL, 0x3ffffffffffL, 0x0L -}; -static final long[] jjbitVec60 = { - 0xfff0fff1fffffffL, 0x1f3fffffffffc0L, 0x0L, 0x0L -}; -static final long[] jjbitVec61 = { - 0x80007c000000f000L, 0x8002fc0f00100001L, 0x3ffff00000000L, 0x7e21fff0000L -}; -static final long[] jjbitVec62 = { - 0x1f3efffe000000e0L, 0xfffffffffffffffeL, 0xfffffffee67fffffL, 0xffffffffffffffffL -}; -static final long[] jjbitVec63 = { - 0x10000000000006L, 0x0L, 0x0L, 0x0L -}; -static final long[] jjbitVec64 = { - 0x3L, 0x0L, 0x0L, 0x0L -}; -static final long[] jjbitVec65 = { - 0x0L, 0x800000000000000L, 0x0L, 0x0L -}; -static final long[] jjbitVec66 = { - 0x5f7ffdffe0f8007fL, 0xffffffffffffffdbL, 0x3ffffffffffffL, 0xfffffffffff80000L -}; -static final long[] jjbitVec67 = { - 0x18000f0000ffffL, 0xffdf02000000e000L, 0xffffffffffffffffL, 0x9fffffffffffffffL -}; -static final long[] jjbitVec68 = { - 0x87fffffe03ff0010L, 0xffffffe007fffffeL, 0x7fffffffffffffffL, 0xe0000631cfcfcfcL -}; -private int jjMoveNfa_0(int startState, int curPos) -{ - int startsAt = 0; - jjnewStateCnt = 86; - int i = 1; - jjstateSet[0] = startState; - int kind = 0x7fffffff; - for (;;) - { - if (++jjround == 0x7fffffff) { - ReInitRounds(); - } - if (curChar < 64) - { - long l = 1L << curChar; - do - { - switch(jjstateSet[--i]) - { - case 54: - if (curChar == 42) { - jjstateSet[jjnewStateCnt++] = 59; - } else if (curChar == 47) - { - if (kind > 6) { - kind = 6; - } - jjCheckNAddStates(0, 2); - } - break; - case 0: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddStates(3, 9); - } else if (curChar == 47) - jjAddStates(10, 11); - else if (curChar == 36) - { - if (kind > 77) { - kind = 77; - } - jjCheckNAdd(37); - } - else if (curChar == 34) - jjCheckNAddStates(12, 15); - else if (curChar == 39) - jjAddStates(16, 18); - else if (curChar == 46) - jjCheckNAdd(1); - if ((0x3fe000000000000L & l) != 0L) - { - if (kind > 66) { - kind = 66; - } - jjCheckNAddStates(19, 21); - } - else if (curChar == 48) - { - if (kind > 66) { - kind = 66; - } - jjCheckNAddStates(22, 28); - } - break; - case 1: - if ((0x3ff000000000000L & l) == 0L) { - break; - } - if (kind > 70) { - kind = 70; - } - jjCheckNAddStates(29, 31); - break; - case 3: - if ((0x280000000000L & l) != 0L) { - jjCheckNAdd(4); - } - break; - case 4: - if ((0x3ff000000000000L & l) == 0L) { - break; - } - if (kind > 70) { - kind = 70; - } - jjCheckNAddTwoStates(4, 5); - break; - case 6: - if (curChar == 39) { - jjAddStates(16, 18); - } - break; - case 7: - if ((0xffffff7fffffdbffL & l) != 0L) { - jjCheckNAdd(8); - } - break; - case 8: - if (curChar == 39 && kind > 75) { - kind = 75; - } - break; - case 10: - if ((0x8400000000L & l) != 0L) { - jjCheckNAdd(8); - } - break; - case 11: - if ((0xff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(12, 8); - } - break; - case 12: - if ((0xff000000000000L & l) != 0L) { - jjCheckNAdd(8); - } - break; - case 13: - if ((0xf000000000000L & l) != 0L) { - jjstateSet[jjnewStateCnt++] = 14; - } - break; - case 14: - if ((0xff000000000000L & l) != 0L) { - jjCheckNAdd(12); - } - break; - case 16: - if ((0x3ff000000000000L & l) != 0L) { - jjstateSet[jjnewStateCnt++] = 17; - } - break; - case 17: - if ((0x3ff000000000000L & l) != 0L) { - jjstateSet[jjnewStateCnt++] = 18; - } - break; - case 18: - if ((0x3ff000000000000L & l) != 0L) { - jjstateSet[jjnewStateCnt++] = 19; - } - break; - case 19: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAdd(8); - } - break; - case 21: - if (curChar == 34) { - jjCheckNAddStates(12, 15); - } - break; - case 22: - if ((0xfffffffbffffdbffL & l) != 0L) { - jjCheckNAddStates(12, 15); - } - break; - case 24: - if ((0x8400000000L & l) != 0L) { - jjCheckNAddStates(12, 15); - } - break; - case 26: - if ((0x3ff000000000000L & l) != 0L) { - jjstateSet[jjnewStateCnt++] = 27; - } - break; - case 27: - if ((0x3ff000000000000L & l) != 0L) { - jjstateSet[jjnewStateCnt++] = 28; - } - break; - case 28: - if ((0x3ff000000000000L & l) != 0L) { - jjstateSet[jjnewStateCnt++] = 29; - } - break; - case 29: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddStates(12, 15); - } - break; - case 31: - if (curChar == 34 && kind > 76) { - kind = 76; - } - break; - case 32: - if ((0xff000000000000L & l) != 0L) { - jjCheckNAddStates(32, 36); - } - break; - case 33: - if ((0xff000000000000L & l) != 0L) { - jjCheckNAddStates(12, 15); - } - break; - case 34: - if ((0xf000000000000L & l) != 0L) { - jjstateSet[jjnewStateCnt++] = 35; - } - break; - case 35: - if ((0xff000000000000L & l) != 0L) { - jjCheckNAdd(33); - } - break; - case 36: - if (curChar != 36) { - break; - } - if (kind > 77) { - kind = 77; - } - jjCheckNAdd(37); - break; - case 37: - if ((0x3ff00100fffc1ffL & l) == 0L) { - break; - } - if (kind > 77) { - kind = 77; - } - jjCheckNAdd(37); - break; - case 38: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddStates(3, 9); - } - break; - case 39: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddStates(37, 39); - } - break; - case 41: - if ((0x280000000000L & l) != 0L) { - jjCheckNAdd(42); - } - break; - case 42: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(42, 5); - } - break; - case 43: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(43, 44); - } - break; - case 45: - if ((0x280000000000L & l) != 0L) { - jjCheckNAdd(46); - } - break; - case 46: - if ((0x3ff000000000000L & l) == 0L) { - break; - } - if (kind > 70) { - kind = 70; - } - jjCheckNAddTwoStates(46, 5); - break; - case 47: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(47, 48); - } - break; - case 48: - if (curChar != 46) { - break; - } - if (kind > 70) { - kind = 70; - } - jjCheckNAddStates(40, 42); - break; - case 49: - if ((0x3ff000000000000L & l) == 0L) { - break; - } - if (kind > 70) { - kind = 70; - } - jjCheckNAddStates(40, 42); - break; - case 51: - if ((0x280000000000L & l) != 0L) { - jjCheckNAdd(52); - } - break; - case 52: - if ((0x3ff000000000000L & l) == 0L) { - break; - } - if (kind > 70) { - kind = 70; - } - jjCheckNAddTwoStates(52, 5); - break; - case 53: - if (curChar == 47) { - jjAddStates(10, 11); - } - break; - case 55: - if ((0xffffffffffffdbffL & l) == 0L) { - break; - } - if (kind > 6) { - kind = 6; - } - jjCheckNAddStates(0, 2); - break; - case 56: - if ((0x2400L & l) != 0L && kind > 6) { - kind = 6; - } - break; - case 57: - if (curChar == 10 && kind > 6) { - kind = 6; - } - break; - case 58: - if (curChar == 13) { - jjstateSet[jjnewStateCnt++] = 57; - } - break; - case 59: - if (curChar == 42) { - jjstateSet[jjnewStateCnt++] = 60; - } - break; - case 60: - if ((0xffff7fffffffffffL & l) != 0L && kind > 7) { - kind = 7; - } - break; - case 61: - if (curChar == 42) { - jjstateSet[jjnewStateCnt++] = 59; - } - break; - case 62: - if ((0x3fe000000000000L & l) == 0L) { - break; - } - if (kind > 66) { - kind = 66; - } - jjCheckNAddStates(19, 21); - break; - case 63: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(63, 64); - } - break; - case 65: - if ((0x3ff000000000000L & l) == 0L) { - break; - } - if (kind > 66) { - kind = 66; - } - jjCheckNAdd(65); - break; - case 66: - if (curChar != 48) { - break; - } - if (kind > 66) { - kind = 66; - } - jjCheckNAddStates(22, 28); - break; - case 68: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(68, 64); - } - break; - case 69: - if ((0xff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(69, 64); - } - break; - case 71: - if ((0x3ff000000000000L & l) == 0L) { - break; - } - if (kind > 66) { - kind = 66; - } - jjstateSet[jjnewStateCnt++] = 71; - break; - case 72: - if ((0xff000000000000L & l) == 0L) { - break; - } - if (kind > 66) { - kind = 66; - } - jjCheckNAdd(72); - break; - case 74: - if ((0x3ff000000000000L & l) != 0L) { - jjAddStates(43, 44); - } - break; - case 75: - if (curChar == 46) { - jjCheckNAdd(76); - } - break; - case 76: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(76, 77); - } - break; - case 78: - if ((0x280000000000L & l) != 0L) { - jjCheckNAdd(79); - } - break; - case 79: - if ((0x3ff000000000000L & l) == 0L) { - break; - } - if (kind > 70) { - kind = 70; - } - jjCheckNAddTwoStates(79, 5); - break; - case 81: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddStates(45, 47); - } - break; - case 82: - if (curChar == 46) { - jjCheckNAdd(83); - } - break; - case 84: - if ((0x280000000000L & l) != 0L) { - jjCheckNAdd(85); - } - break; - case 85: - if ((0x3ff000000000000L & l) == 0L) { - break; - } - if (kind > 70) { - kind = 70; - } - jjCheckNAddTwoStates(85, 5); - break; - default : break; - } - } while (i != startsAt); - } - else if (curChar < 128) - { - long l = 1L << (curChar & 077); - do - { - switch(jjstateSet[--i]) - { - case 0: - if ((0x7fffffe87fffffeL & l) == 0L) { - break; - } - if (kind > 77) { - kind = 77; - } - jjCheckNAdd(37); - break; - case 2: - if ((0x2000000020L & l) != 0L) { - jjAddStates(48, 49); - } - break; - case 5: - if ((0x5000000050L & l) != 0L && kind > 70) { - kind = 70; - } - break; - case 7: - if ((0xffffffffefffffffL & l) != 0L) { - jjCheckNAdd(8); - } - break; - case 9: - if (curChar == 92) { - jjAddStates(50, 52); - } - break; - case 10: - if ((0x14404410000000L & l) != 0L) { - jjCheckNAdd(8); - } - break; - case 15: - if (curChar == 117) { - jjstateSet[jjnewStateCnt++] = 16; - } - break; - case 16: - if ((0x7e0000007eL & l) != 0L) { - jjstateSet[jjnewStateCnt++] = 17; - } - break; - case 17: - if ((0x7e0000007eL & l) != 0L) { - jjstateSet[jjnewStateCnt++] = 18; - } - break; - case 18: - if ((0x7e0000007eL & l) != 0L) { - jjstateSet[jjnewStateCnt++] = 19; - } - break; - case 19: - if ((0x7e0000007eL & l) != 0L) { - jjCheckNAdd(8); - } - break; - case 20: - if (curChar == 92) { - jjstateSet[jjnewStateCnt++] = 15; - } - break; - case 22: - if ((0xffffffffefffffffL & l) != 0L) { - jjCheckNAddStates(12, 15); - } - break; - case 23: - if (curChar == 92) { - jjAddStates(53, 55); - } - break; - case 24: - if ((0x14404410000000L & l) != 0L) { - jjCheckNAddStates(12, 15); - } - break; - case 25: - if (curChar == 117) { - jjstateSet[jjnewStateCnt++] = 26; - } - break; - case 26: - if ((0x7e0000007eL & l) != 0L) { - jjstateSet[jjnewStateCnt++] = 27; - } - break; - case 27: - if ((0x7e0000007eL & l) != 0L) { - jjstateSet[jjnewStateCnt++] = 28; - } - break; - case 28: - if ((0x7e0000007eL & l) != 0L) { - jjstateSet[jjnewStateCnt++] = 29; - } - break; - case 29: - if ((0x7e0000007eL & l) != 0L) { - jjCheckNAddStates(12, 15); - } - break; - case 30: - if (curChar == 92) { - jjstateSet[jjnewStateCnt++] = 25; - } - break; - case 37: - if ((0x87fffffe87fffffeL & l) == 0L) { - break; - } - if (kind > 77) { - kind = 77; - } - jjCheckNAdd(37); - break; - case 40: - if ((0x2000000020L & l) != 0L) { - jjAddStates(56, 57); - } - break; - case 44: - if ((0x2000000020L & l) != 0L) { - jjAddStates(58, 59); - } - break; - case 50: - if ((0x2000000020L & l) != 0L) { - jjAddStates(60, 61); - } - break; - case 55: - if (kind > 6) { - kind = 6; - } - jjAddStates(0, 2); - break; - case 60: - if (kind > 7) { - kind = 7; - } - break; - case 64: - if ((0x100000001000L & l) != 0L && kind > 65) { - kind = 65; - } - break; - case 67: - if ((0x100000001000000L & l) != 0L) { - jjCheckNAdd(68); - } - break; - case 68: - if ((0x7e0000007eL & l) != 0L) { - jjCheckNAddTwoStates(68, 64); - } - break; - case 70: - if ((0x100000001000000L & l) != 0L) { - jjCheckNAdd(71); - } - break; - case 71: - if ((0x7e0000007eL & l) == 0L) { - break; - } - if (kind > 66) { - kind = 66; - } - jjCheckNAdd(71); - break; - case 73: - if ((0x100000001000000L & l) != 0L) { - jjCheckNAddTwoStates(74, 75); - } - break; - case 74: - if ((0x7e0000007eL & l) != 0L) { - jjCheckNAddTwoStates(74, 75); - } - break; - case 76: - if ((0x7e0000007eL & l) != 0L) { - jjAddStates(62, 63); - } - break; - case 77: - if ((0x1000000010000L & l) != 0L) { - jjAddStates(64, 65); - } - break; - case 80: - if ((0x100000001000000L & l) != 0L) { - jjCheckNAdd(81); - } - break; - case 81: - if ((0x7e0000007eL & l) != 0L) { - jjCheckNAddStates(45, 47); - } - break; - case 83: - if ((0x1000000010000L & l) != 0L) { - jjAddStates(66, 67); - } - break; - default : break; - } - } while (i != startsAt); - } - else - { - int hiByte = curChar >> 8; - int i1 = hiByte >> 6; - long l1 = 1L << (hiByte & 077); - int i2 = (curChar & 0xff) >> 6; - long l2 = 1L << (curChar & 077); - do - { - switch(jjstateSet[--i]) - { - case 0: - if (!jjCanMove_1(hiByte, i1, i2, l1, l2)) { - break; - } - if (kind > 77) { - kind = 77; - } - jjCheckNAdd(37); - break; - case 7: - if (jjCanMove_0(hiByte, i1, i2, l1, l2)) { - jjstateSet[jjnewStateCnt++] = 8; - } - break; - case 22: - if (jjCanMove_0(hiByte, i1, i2, l1, l2)) { - jjAddStates(12, 15); - } - break; - case 37: - if (!jjCanMove_2(hiByte, i1, i2, l1, l2)) { - break; - } - if (kind > 77) { - kind = 77; - } - jjCheckNAdd(37); - break; - case 55: - if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) { - break; - } - if (kind > 6) { - kind = 6; - } - jjAddStates(0, 2); - break; - case 60: - if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 7) { - kind = 7; - } - break; - default : break; - } - } while (i != startsAt); - } - if (kind != 0x7fffffff) - { - jjmatchedKind = kind; - jjmatchedPos = curPos; - kind = 0x7fffffff; - } - ++curPos; - if ((i = jjnewStateCnt) == (startsAt = 86 - (jjnewStateCnt = startsAt))) { - return curPos; - } - try { curChar = input_stream.readChar(); } - catch (java.io.IOException e) { return curPos; } - } -} -private int jjMoveStringLiteralDfa0_2() -{ - switch(curChar) - { - case 42: - return jjMoveStringLiteralDfa1_2(0x400L); - default : - return 1; - } -} -private int jjMoveStringLiteralDfa1_2(long active0) -{ - try { curChar = input_stream.readChar(); } - catch (java.io.IOException e) { - return 1; - } - switch(curChar) - { - case 47: - if ((active0 & 0x400L) != 0L) { - return jjStopAtPos(1, 10); - } - break; - default : - return 2; - } - return 2; -} -private int jjMoveStringLiteralDfa0_1() -{ - switch(curChar) - { - case 42: - return jjMoveStringLiteralDfa1_1(0x200L); - default : - return 1; - } -} -private int jjMoveStringLiteralDfa1_1(long active0) -{ - try { curChar = input_stream.readChar(); } - catch (java.io.IOException e) { - return 1; - } - switch(curChar) - { - case 47: - if ((active0 & 0x200L) != 0L) { - return jjStopAtPos(1, 9); - } - break; - default : - return 2; - } - return 2; -} -static final int[] jjnextStates = { - 55, 56, 58, 39, 40, 5, 43, 44, 47, 48, 54, 61, 22, 23, 30, 31, - 7, 9, 20, 63, 64, 65, 67, 69, 64, 70, 72, 73, 80, 1, 2, 5, - 22, 23, 33, 30, 31, 39, 40, 5, 49, 50, 5, 74, 75, 81, 82, 83, - 3, 4, 10, 11, 13, 24, 32, 34, 41, 42, 45, 46, 51, 52, 76, 77, - 78, 79, 84, 85, -}; -private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2) -{ - switch(hiByte) - { - case 0: - return ((jjbitVec2[i2] & l2) != 0L); - default : - if ((jjbitVec0[i1] & l1) != 0L) { - return true; - } - return false; - } -} -private static final boolean jjCanMove_1(int hiByte, int i1, int i2, long l1, long l2) -{ - switch(hiByte) - { - case 0: - return ((jjbitVec4[i2] & l2) != 0L); - case 2: - return ((jjbitVec5[i2] & l2) != 0L); - case 3: - return ((jjbitVec6[i2] & l2) != 0L); - case 4: - return ((jjbitVec7[i2] & l2) != 0L); - case 5: - return ((jjbitVec8[i2] & l2) != 0L); - case 6: - return ((jjbitVec9[i2] & l2) != 0L); - case 7: - return ((jjbitVec10[i2] & l2) != 0L); - case 9: - return ((jjbitVec11[i2] & l2) != 0L); - case 10: - return ((jjbitVec12[i2] & l2) != 0L); - case 11: - return ((jjbitVec13[i2] & l2) != 0L); - case 12: - return ((jjbitVec14[i2] & l2) != 0L); - case 13: - return ((jjbitVec15[i2] & l2) != 0L); - case 14: - return ((jjbitVec16[i2] & l2) != 0L); - case 15: - return ((jjbitVec17[i2] & l2) != 0L); - case 16: - return ((jjbitVec18[i2] & l2) != 0L); - case 17: - return ((jjbitVec19[i2] & l2) != 0L); - case 18: - return ((jjbitVec20[i2] & l2) != 0L); - case 19: - return ((jjbitVec21[i2] & l2) != 0L); - case 20: - return ((jjbitVec0[i2] & l2) != 0L); - case 22: - return ((jjbitVec22[i2] & l2) != 0L); - case 23: - return ((jjbitVec23[i2] & l2) != 0L); - case 24: - return ((jjbitVec24[i2] & l2) != 0L); - case 25: - return ((jjbitVec25[i2] & l2) != 0L); - case 29: - return ((jjbitVec26[i2] & l2) != 0L); - case 30: - return ((jjbitVec27[i2] & l2) != 0L); - case 31: - return ((jjbitVec28[i2] & l2) != 0L); - case 32: - return ((jjbitVec29[i2] & l2) != 0L); - case 33: - return ((jjbitVec30[i2] & l2) != 0L); - case 48: - return ((jjbitVec31[i2] & l2) != 0L); - case 49: - return ((jjbitVec32[i2] & l2) != 0L); - case 77: - return ((jjbitVec33[i2] & l2) != 0L); - case 159: - return ((jjbitVec34[i2] & l2) != 0L); - case 164: - return ((jjbitVec35[i2] & l2) != 0L); - case 215: - return ((jjbitVec36[i2] & l2) != 0L); - case 216: - return ((jjbitVec37[i2] & l2) != 0L); - case 250: - return ((jjbitVec38[i2] & l2) != 0L); - case 251: - return ((jjbitVec39[i2] & l2) != 0L); - case 253: - return ((jjbitVec40[i2] & l2) != 0L); - case 254: - return ((jjbitVec41[i2] & l2) != 0L); - case 255: - return ((jjbitVec42[i2] & l2) != 0L); - default : - if ((jjbitVec3[i1] & l1) != 0L) { - return true; - } - return false; - } -} -private static final boolean jjCanMove_2(int hiByte, int i1, int i2, long l1, long l2) -{ - switch(hiByte) - { - case 0: - return ((jjbitVec43[i2] & l2) != 0L); - case 2: - return ((jjbitVec5[i2] & l2) != 0L); - case 3: - return ((jjbitVec44[i2] & l2) != 0L); - case 4: - return ((jjbitVec45[i2] & l2) != 0L); - case 5: - return ((jjbitVec46[i2] & l2) != 0L); - case 6: - return ((jjbitVec47[i2] & l2) != 0L); - case 7: - return ((jjbitVec48[i2] & l2) != 0L); - case 9: - return ((jjbitVec49[i2] & l2) != 0L); - case 10: - return ((jjbitVec50[i2] & l2) != 0L); - case 11: - return ((jjbitVec51[i2] & l2) != 0L); - case 12: - return ((jjbitVec52[i2] & l2) != 0L); - case 13: - return ((jjbitVec53[i2] & l2) != 0L); - case 14: - return ((jjbitVec54[i2] & l2) != 0L); - case 15: - return ((jjbitVec55[i2] & l2) != 0L); - case 16: - return ((jjbitVec56[i2] & l2) != 0L); - case 17: - return ((jjbitVec19[i2] & l2) != 0L); - case 18: - return ((jjbitVec20[i2] & l2) != 0L); - case 19: - return ((jjbitVec57[i2] & l2) != 0L); - case 20: - return ((jjbitVec0[i2] & l2) != 0L); - case 22: - return ((jjbitVec22[i2] & l2) != 0L); - case 23: - return ((jjbitVec58[i2] & l2) != 0L); - case 24: - return ((jjbitVec59[i2] & l2) != 0L); - case 25: - return ((jjbitVec60[i2] & l2) != 0L); - case 29: - return ((jjbitVec26[i2] & l2) != 0L); - case 30: - return ((jjbitVec27[i2] & l2) != 0L); - case 31: - return ((jjbitVec28[i2] & l2) != 0L); - case 32: - return ((jjbitVec61[i2] & l2) != 0L); - case 33: - return ((jjbitVec30[i2] & l2) != 0L); - case 48: - return ((jjbitVec62[i2] & l2) != 0L); - case 49: - return ((jjbitVec32[i2] & l2) != 0L); - case 77: - return ((jjbitVec33[i2] & l2) != 0L); - case 159: - return ((jjbitVec34[i2] & l2) != 0L); - case 164: - return ((jjbitVec35[i2] & l2) != 0L); - case 215: - return ((jjbitVec36[i2] & l2) != 0L); - case 216: - return ((jjbitVec63[i2] & l2) != 0L); - case 220: - return ((jjbitVec64[i2] & l2) != 0L); - case 221: - return ((jjbitVec65[i2] & l2) != 0L); - case 250: - return ((jjbitVec38[i2] & l2) != 0L); - case 251: - return ((jjbitVec66[i2] & l2) != 0L); - case 253: - return ((jjbitVec40[i2] & l2) != 0L); - case 254: - return ((jjbitVec67[i2] & l2) != 0L); - case 255: - return ((jjbitVec68[i2] & l2) != 0L); - default : - if ((jjbitVec3[i1] & l1) != 0L) { - return true; - } - return false; - } -} - -/** Token literal values. */ -public static final String[] jjstrLiteralImages = { -"", null, null, null, null, null, null, null, null, null, null, null, -"\141\142\163\164\162\141\143\164", "\141\163\163\145\162\164", "\142\157\157\154\145\141\156", -"\142\162\145\141\153", "\142\171\164\145", "\143\141\163\145", "\143\141\164\143\150", -"\143\150\141\162", "\143\154\141\163\163", "\143\157\156\163\164", -"\143\157\156\164\151\156\165\145", "\144\145\146\141\165\154\164", "\144\157", "\144\157\165\142\154\145", -"\145\154\163\145", "\145\156\165\155", "\145\170\164\145\156\144\163", "\146\141\154\163\145", -"\146\151\156\141\154", "\146\151\156\141\154\154\171", "\146\154\157\141\164", "\146\157\162", -"\147\157\164\157", "\151\146", "\151\155\160\154\145\155\145\156\164\163", -"\151\155\160\157\162\164", "\151\156\163\164\141\156\143\145\157\146", "\151\156\164", -"\151\156\164\145\162\146\141\143\145", "\154\157\156\147", "\156\141\164\151\166\145", "\156\145\167", -"\156\165\154\154", "\160\141\143\153\141\147\145", "\160\162\151\166\141\164\145", -"\160\162\157\164\145\143\164\145\144", "\160\165\142\154\151\143", "\162\145\164\165\162\156", -"\163\150\157\162\164", "\163\164\141\164\151\143", "\163\164\162\151\143\164\146\160", -"\163\165\160\145\162", "\163\167\151\164\143\150", -"\163\171\156\143\150\162\157\156\151\172\145\144", "\164\150\151\163", "\164\150\162\157\167", "\164\150\162\157\167\163", -"\164\162\141\156\163\151\145\156\164", "\164\162\165\145", "\164\162\171", "\166\157\151\144", -"\166\157\154\141\164\151\154\145", "\167\150\151\154\145", null, null, null, null, null, null, null, null, null, -null, null, null, null, null, null, "\50", "\51", "\173", "\175", "\133", "\135", -"\73", "\54", "\56", "\100", "\75", "\74", "\41", "\176", "\77", "\72", "\75\75", -"\74\75", "\76\75", "\41\75", "\174\174", "\46\46", "\53\53", "\55\55", "\53", "\55", -"\52", "\57", "\46", "\174", "\136", "\45", "\74\74", "\53\75", "\55\75", "\52\75", -"\57\75", "\46\75", "\174\75", "\136\75", "\45\75", "\74\74\75", "\76\76\75", -"\76\76\76\75", "\56\56\56", "\76\76\76", "\76\76", "\76", "\32", }; - -/** Lexer state names. */ -public static final String[] lexStateNames = { - "DEFAULT", - "IN_JAVA_DOC_COMMENT", - "IN_MULTI_LINE_COMMENT", -}; - -/** Lex State array. */ -public static final int[] jjnewLexState = { - -1, -1, -1, -1, -1, -1, -1, 1, 2, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -}; -static final long[] jjtoToken = { - 0xfffffffffffff001L, 0xffffffffffff3847L, 0x1L, -}; -static final long[] jjtoSkip = { - 0x67eL, 0x0L, 0x0L, -}; -static final long[] jjtoSpecial = { - 0x640L, 0x0L, 0x0L, -}; -static final long[] jjtoMore = { - 0x980L, 0x0L, 0x0L, -}; -protected JavaCharStream input_stream; -private final int[] jjrounds = new int[86]; -private final int[] jjstateSet = new int[172]; -private final StringBuilder jjimage = new StringBuilder(); -private StringBuilder image = jjimage; -private int jjimageLen; -private int lengthOfMatch; -protected char curChar; -/** Constructor. */ -public ASTParserTokenManager(JavaCharStream stream){ - if (JavaCharStream.staticFlag) { - throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); - } - input_stream = stream; -} - -/** Constructor. */ -public ASTParserTokenManager(JavaCharStream stream, int lexState){ - this(stream); - SwitchTo(lexState); -} - -/** Reinitialise parser. */ -public void ReInit(JavaCharStream stream) -{ - jjmatchedPos = jjnewStateCnt = 0; - curLexState = defaultLexState; - input_stream = stream; - ReInitRounds(); -} -private void ReInitRounds() -{ - int i; - jjround = 0x80000001; - for (i = 86; i-- > 0;) { - jjrounds[i] = 0x80000000; - } -} - -/** Reinitialise parser. */ -public void ReInit(JavaCharStream stream, int lexState) -{ - ReInit(stream); - SwitchTo(lexState); -} - -/** Switch to specified lex state. */ -public void SwitchTo(int lexState) -{ - if (lexState >= 3 || lexState < 0) { - throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); - } else - curLexState = lexState; -} - -protected Token jjFillToken() -{ - final Token t; - final String curTokenImage; - final int beginLine; - final int endLine; - final int beginColumn; - final int endColumn; - String im = jjstrLiteralImages[jjmatchedKind]; - curTokenImage = (im == null) ? input_stream.GetImage() : im; - beginLine = input_stream.getBeginLine(); - beginColumn = input_stream.getBeginColumn(); - endLine = input_stream.getEndLine(); - endColumn = input_stream.getEndColumn(); - t = ASTParser.GTToken.newToken(jjmatchedKind, curTokenImage); - - t.beginLine = beginLine; - t.endLine = endLine; - t.beginColumn = beginColumn; - t.endColumn = endColumn; - - return t; -} - -int curLexState = 0; -int defaultLexState = 0; -int jjnewStateCnt; -int jjround; -int jjmatchedPos; -int jjmatchedKind; - -/** Get the next Token. */ -public Token getNextToken() -{ - Token specialToken = null; - Token matchedToken; - int curPos = 0; - - EOFLoop : - for (;;) - { - try - { - curChar = input_stream.BeginToken(); - } - catch (java.io.IOException e) - { - jjmatchedKind = 0; - matchedToken = jjFillToken(); - matchedToken.specialToken = specialToken; - CommonTokenAction(matchedToken); - return matchedToken; - } - image = jjimage; - image.setLength(0); - jjimageLen = 0; - - for (;;) - { - switch(curLexState) - { - case 0: - try { input_stream.backup(0); - while (curChar <= 32 && (0x100003600L & (1L << curChar)) != 0L) - curChar = input_stream.BeginToken(); - } - catch (java.io.IOException e1) { continue EOFLoop; } - jjmatchedKind = 0x7fffffff; - jjmatchedPos = 0; - curPos = jjMoveStringLiteralDfa0_0(); - break; - case 1: - jjmatchedKind = 0x7fffffff; - jjmatchedPos = 0; - curPos = jjMoveStringLiteralDfa0_1(); - if (jjmatchedPos == 0 && jjmatchedKind > 11) - { - jjmatchedKind = 11; - } - break; - case 2: - jjmatchedKind = 0x7fffffff; - jjmatchedPos = 0; - curPos = jjMoveStringLiteralDfa0_2(); - if (jjmatchedPos == 0 && jjmatchedKind > 11) - { - jjmatchedKind = 11; - } - break; - } - if (jjmatchedKind != 0x7fffffff) - { - if (jjmatchedPos + 1 < curPos) { - input_stream.backup(curPos - jjmatchedPos - 1); - } - if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) - { - matchedToken = jjFillToken(); - matchedToken.specialToken = specialToken; - TokenLexicalActions(matchedToken); - if (jjnewLexState[jjmatchedKind] != -1) { - curLexState = jjnewLexState[jjmatchedKind]; - } - CommonTokenAction(matchedToken); - return matchedToken; - } - else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) - { - if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) - { - matchedToken = jjFillToken(); - if (specialToken == null) { - specialToken = matchedToken; - } else - { - matchedToken.specialToken = specialToken; - specialToken = (specialToken.next = matchedToken); - } - SkipLexicalActions(matchedToken); - } - else - SkipLexicalActions(null); - if (jjnewLexState[jjmatchedKind] != -1) { - curLexState = jjnewLexState[jjmatchedKind]; - } - continue EOFLoop; - } - MoreLexicalActions(); - if (jjnewLexState[jjmatchedKind] != -1) { - curLexState = jjnewLexState[jjmatchedKind]; - } - curPos = 0; - jjmatchedKind = 0x7fffffff; - try { - curChar = input_stream.readChar(); - continue; - } - catch (java.io.IOException e1) { } - } - int error_line = input_stream.getEndLine(); - int error_column = input_stream.getEndColumn(); - String error_after = null; - boolean EOFSeen = false; - try { input_stream.readChar(); input_stream.backup(1); } - catch (java.io.IOException e1) { - EOFSeen = true; - error_after = curPos <= 1 ? "" : input_stream.GetImage(); - if (curChar == '\n' || curChar == '\r') { - error_line++; - error_column = 0; - } - else - error_column++; - } - if (!EOFSeen) { - input_stream.backup(1); - error_after = curPos <= 1 ? "" : input_stream.GetImage(); - } - throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR); - } - } -} - -void SkipLexicalActions(Token matchedToken) -{ - switch(jjmatchedKind) - { - default : - break; - } -} -void MoreLexicalActions() -{ - jjimageLen += (lengthOfMatch = jjmatchedPos + 1); - switch(jjmatchedKind) - { - case 7 : - image.append(input_stream.GetSuffix(jjimageLen)); - jjimageLen = 0; - input_stream.backup(1); - break; - default : - break; - } -} -void TokenLexicalActions(Token matchedToken) -{ - switch(jjmatchedKind) - { - case 125 : - image.append(jjstrLiteralImages[125]); - lengthOfMatch = jjstrLiteralImages[125].length(); - matchedToken.kind = GT; - ((ASTParser.GTToken)matchedToken).realKind = RUNSIGNEDSHIFT; - input_stream.backup(2); - break; - case 126 : - image.append(jjstrLiteralImages[126]); - lengthOfMatch = jjstrLiteralImages[126].length(); - matchedToken.kind = GT; - ((ASTParser.GTToken)matchedToken).realKind = RSIGNEDSHIFT; - input_stream.backup(1); - break; - default : - break; - } -} -private void jjCheckNAdd(int state) -{ - if (jjrounds[state] != jjround) - { - jjstateSet[jjnewStateCnt++] = state; - jjrounds[state] = jjround; - } -} -private void jjAddStates(int start, int end) -{ - do { - jjstateSet[jjnewStateCnt++] = jjnextStates[start]; - } while (start++ != end); -} -private void jjCheckNAddTwoStates(int state1, int state2) -{ - jjCheckNAdd(state1); - jjCheckNAdd(state2); -} - -private void jjCheckNAddStates(int start, int end) -{ - do { - jjCheckNAdd(jjnextStates[start]); - } while (start++ != end); -} - -} diff --git a/stubparser/src/org/checkerframework/stubparser/JavaCharStream.java b/stubparser/src/org/checkerframework/stubparser/JavaCharStream.java deleted file mode 100644 index e353ed0d4a0..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/JavaCharStream.java +++ /dev/null @@ -1,644 +0,0 @@ -/* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 5.0 */ -/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ -/* - * Copyright (C) 2008 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -package org.checkerframework.stubparser; - -/** - * An implementation of interface CharStream, where the stream is assumed to - * contain only ASCII characters (with java-like unicode escape processing). - */ - -public -class JavaCharStream -{ - /** Whether parser is static. */ - public static final boolean staticFlag = false; - - static final int hexval(char c) throws java.io.IOException { - switch(c) - { - case '0' : - return 0; - case '1' : - return 1; - case '2' : - return 2; - case '3' : - return 3; - case '4' : - return 4; - case '5' : - return 5; - case '6' : - return 6; - case '7' : - return 7; - case '8' : - return 8; - case '9' : - return 9; - - case 'a' : - case 'A' : - return 10; - case 'b' : - case 'B' : - return 11; - case 'c' : - case 'C' : - return 12; - case 'd' : - case 'D' : - return 13; - case 'e' : - case 'E' : - return 14; - case 'f' : - case 'F' : - return 15; - } - - throw new java.io.IOException(); // Should never come here - } - -/** Position in buffer. */ - public int bufpos = -1; - int bufsize; - int available; - int tokenBegin; - protected int bufline[]; - protected int bufcolumn[]; - - protected int column = 0; - protected int line = 1; - - protected boolean prevCharIsCR = false; - protected boolean prevCharIsLF = false; - - protected java.io.Reader inputStream; - - protected char[] nextCharBuf; - protected char[] buffer; - protected int maxNextCharInd = 0; - protected int nextCharInd = -1; - protected int inBuf = 0; - protected int tabSize = 8; - - protected void setTabSize(int i) { tabSize = i; } - protected int getTabSize(int i) { return tabSize; } - - protected void ExpandBuff(boolean wrapAround) - { - char[] newbuffer = new char[bufsize + 2048]; - int newbufline[] = new int[bufsize + 2048]; - int newbufcolumn[] = new int[bufsize + 2048]; - - try - { - if (wrapAround) - { - System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); - System.arraycopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos); - buffer = newbuffer; - - System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); - System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos); - bufline = newbufline; - - System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); - System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos); - bufcolumn = newbufcolumn; - - bufpos += (bufsize - tokenBegin); - } - else - { - System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); - buffer = newbuffer; - - System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); - bufline = newbufline; - - System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); - bufcolumn = newbufcolumn; - - bufpos -= tokenBegin; - } - } - catch (Throwable t) - { - throw new Error(t.getMessage()); - } - - available = (bufsize += 2048); - tokenBegin = 0; - } - - protected void FillBuff() throws java.io.IOException - { - int i; - if (maxNextCharInd == 4096) { - maxNextCharInd = nextCharInd = 0; - } - - try { - if ((i = inputStream.read(nextCharBuf, maxNextCharInd, - 4096 - maxNextCharInd)) == -1) - { - inputStream.close(); - throw new java.io.IOException(); - } - else - maxNextCharInd += i; - return; - } - catch (java.io.IOException e) { - if (bufpos != 0) - { - --bufpos; - backup(0); - } - else - { - bufline[bufpos] = line; - bufcolumn[bufpos] = column; - } - throw e; - } - } - - protected char ReadByte() throws java.io.IOException - { - if (++nextCharInd >= maxNextCharInd) { - FillBuff(); - } - - return nextCharBuf[nextCharInd]; - } - -/** @return starting character for token. */ - public char BeginToken() throws java.io.IOException - { - if (inBuf > 0) - { - --inBuf; - - if (++bufpos == bufsize) { - bufpos = 0; - } - - tokenBegin = bufpos; - return buffer[bufpos]; - } - - tokenBegin = 0; - bufpos = -1; - - return readChar(); - } - - protected void AdjustBuffSize() - { - if (available == bufsize) - { - if (tokenBegin > 2048) - { - bufpos = 0; - available = tokenBegin; - } - else - ExpandBuff(false); - } - else if (available > tokenBegin) - available = bufsize; - else if ((tokenBegin - available) < 2048) - ExpandBuff(true); - else - available = tokenBegin; - } - - protected void UpdateLineColumn(char c) - { - column++; - - if (prevCharIsLF) - { - prevCharIsLF = false; - line += (column = 1); - } - else if (prevCharIsCR) - { - prevCharIsCR = false; - if (c == '\n') - { - prevCharIsLF = true; - } - else - line += (column = 1); - } - - switch (c) - { - case '\r' : - prevCharIsCR = true; - break; - case '\n' : - prevCharIsLF = true; - break; - case '\t' : - column--; - column += (tabSize - (column % tabSize)); - break; - default : - break; - } - - bufline[bufpos] = line; - bufcolumn[bufpos] = column; - } - -/** Read a character. */ - public char readChar() throws java.io.IOException - { - if (inBuf > 0) - { - --inBuf; - - if (++bufpos == bufsize) { - bufpos = 0; - } - - return buffer[bufpos]; - } - - char c; - - if (++bufpos == available) { - AdjustBuffSize(); - } - - if ((buffer[bufpos] = c = ReadByte()) == '\\') - { - UpdateLineColumn(c); - - int backSlashCnt = 1; - - for (;;) // Read all the backslashes - { - if (++bufpos == available) { - AdjustBuffSize(); - } - - try - { - if ((buffer[bufpos] = c = ReadByte()) != '\\') - { - UpdateLineColumn(c); - // found a non-backslash char. - if ((c == 'u') && ((backSlashCnt & 1) == 1)) - { - if (--bufpos < 0) { - bufpos = bufsize - 1; - } - - break; - } - - backup(backSlashCnt); - return '\\'; - } - } - catch (java.io.IOException e) - { - // We are returning one backslash so we should only backup (count-1) - if (backSlashCnt > 1) { - backup(backSlashCnt-1); - } - - return '\\'; - } - - UpdateLineColumn(c); - backSlashCnt++; - } - - // Here, we have seen an odd number of backslash's followed by a 'u' - try - { - while ((c = ReadByte()) == 'u') - ++column; - - buffer[bufpos] = c = (char)(hexval(c) << 12 | - hexval(ReadByte()) << 8 | - hexval(ReadByte()) << 4 | - hexval(ReadByte())); - - column += 4; - } - catch (java.io.IOException e) - { - throw new Error("Invalid escape character at line " + line + - " column " + column + "."); - } - - if (backSlashCnt == 1) { - return c; - } else - { - backup(backSlashCnt - 1); - return '\\'; - } - } - else - { - UpdateLineColumn(c); - return c; - } - } - - @Deprecated - /** - * @deprecated - * @see #getEndColumn - */ - public int getColumn() { - return bufcolumn[bufpos]; - } - - @Deprecated - /** - * @deprecated - * @see #getEndLine - */ - public int getLine() { - return bufline[bufpos]; - } - -/** Get end column. */ - public int getEndColumn() { - return bufcolumn[bufpos]; - } - -/** Get end line. */ - public int getEndLine() { - return bufline[bufpos]; - } - -/** @return column of token start */ - public int getBeginColumn() { - return bufcolumn[tokenBegin]; - } - -/** @return line number of token start */ - public int getBeginLine() { - return bufline[tokenBegin]; - } - -/** Retreat. */ - public void backup(int amount) { - - inBuf += amount; - if ((bufpos -= amount) < 0) { - bufpos += bufsize; - } - } - -/** Constructor. */ - public JavaCharStream(java.io.Reader dstream, - int startline, int startcolumn, int buffersize) - { - inputStream = dstream; - line = startline; - column = startcolumn - 1; - - available = bufsize = buffersize; - buffer = new char[buffersize]; - bufline = new int[buffersize]; - bufcolumn = new int[buffersize]; - nextCharBuf = new char[4096]; - } - -/** Constructor. */ - public JavaCharStream(java.io.Reader dstream, - int startline, int startcolumn) - { - this(dstream, startline, startcolumn, 4096); - } - -/** Constructor. */ - public JavaCharStream(java.io.Reader dstream) - { - this(dstream, 1, 1, 4096); - } -/** Reinitialise. */ - public void ReInit(java.io.Reader dstream, - int startline, int startcolumn, int buffersize) - { - inputStream = dstream; - line = startline; - column = startcolumn - 1; - - if (buffer == null || buffersize != buffer.length) - { - available = bufsize = buffersize; - buffer = new char[buffersize]; - bufline = new int[buffersize]; - bufcolumn = new int[buffersize]; - nextCharBuf = new char[4096]; - } - prevCharIsLF = prevCharIsCR = false; - tokenBegin = inBuf = maxNextCharInd = 0; - nextCharInd = bufpos = -1; - } - -/** Reinitialise. */ - public void ReInit(java.io.Reader dstream, - int startline, int startcolumn) - { - ReInit(dstream, startline, startcolumn, 4096); - } - -/** Reinitialise. */ - public void ReInit(java.io.Reader dstream) - { - ReInit(dstream, 1, 1, 4096); - } -/** Constructor. */ - public JavaCharStream(java.io.InputStream dstream, String encoding, int startline, - int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException - { - this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize); - } - -/** Constructor. */ - public JavaCharStream(java.io.InputStream dstream, int startline, - int startcolumn, int buffersize) - { - this(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize); - } - -/** Constructor. */ - public JavaCharStream(java.io.InputStream dstream, String encoding, int startline, - int startcolumn) throws java.io.UnsupportedEncodingException - { - this(dstream, encoding, startline, startcolumn, 4096); - } - -/** Constructor. */ - public JavaCharStream(java.io.InputStream dstream, int startline, - int startcolumn) - { - this(dstream, startline, startcolumn, 4096); - } - -/** Constructor. */ - public JavaCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException - { - this(dstream, encoding, 1, 1, 4096); - } - -/** Constructor. */ - public JavaCharStream(java.io.InputStream dstream) - { - this(dstream, 1, 1, 4096); - } - -/** Reinitialise. */ - public void ReInit(java.io.InputStream dstream, String encoding, int startline, - int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException - { - ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize); - } - -/** Reinitialise. */ - public void ReInit(java.io.InputStream dstream, int startline, - int startcolumn, int buffersize) - { - ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize); - } -/** Reinitialise. */ - public void ReInit(java.io.InputStream dstream, String encoding, int startline, - int startcolumn) throws java.io.UnsupportedEncodingException - { - ReInit(dstream, encoding, startline, startcolumn, 4096); - } -/** Reinitialise. */ - public void ReInit(java.io.InputStream dstream, int startline, - int startcolumn) - { - ReInit(dstream, startline, startcolumn, 4096); - } -/** Reinitialise. */ - public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException - { - ReInit(dstream, encoding, 1, 1, 4096); - } - -/** Reinitialise. */ - public void ReInit(java.io.InputStream dstream) - { - ReInit(dstream, 1, 1, 4096); - } - - /** @return token image as String */ - public String GetImage() - { - if (bufpos >= tokenBegin) { - return new String(buffer, tokenBegin, bufpos - tokenBegin + 1); - } else - return new String(buffer, tokenBegin, bufsize - tokenBegin) + - new String(buffer, 0, bufpos + 1); - } - - /** @return suffix */ - public char[] GetSuffix(int len) - { - char[] ret = new char[len]; - - if ((bufpos + 1) >= len) { - System.arraycopy(buffer, bufpos - len + 1, ret, 0, len); - } else - { - System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0, - len - bufpos - 1); - System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1); - } - - return ret; - } - - /** Set buffers back to null when finished. */ - public void Done() - { - nextCharBuf = null; - buffer = null; - bufline = null; - bufcolumn = null; - } - - /** - * Method to adjust line and column numbers for the start of a token. - */ - public void adjustBeginLineColumn(int newLine, int newCol) - { - int start = tokenBegin; - int len; - - if (bufpos >= tokenBegin) - { - len = bufpos - tokenBegin + inBuf + 1; - } - else - { - len = bufsize - tokenBegin + bufpos + 1 + inBuf; - } - - int i = 0, j = 0, k = 0; - int nextColDiff = 0, columnDiff = 0; - - while (i < len && bufline[j = start % bufsize] == bufline[k = ++start % bufsize]) - { - bufline[j] = newLine; - nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j]; - bufcolumn[j] = newCol + columnDiff; - columnDiff = nextColDiff; - i++; - } - - if (i < len) - { - bufline[j] = newLine++; - bufcolumn[j] = newCol + columnDiff; - - while (i++ < len) - { - if (bufline[j = start % bufsize] != bufline[++start % bufsize]) { - bufline[j] = newLine++; - } else - bufline[j] = newLine; - } - } - - line = bufline[j]; - column = bufcolumn[j]; - } - -} -/* JavaCC - OriginalChecksum=a9554b5268ee777c60eb53f84c03c865 (do not edit this line) */ diff --git a/stubparser/src/org/checkerframework/stubparser/JavaParser.java b/stubparser/src/org/checkerframework/stubparser/JavaParser.java deleted file mode 100644 index afd162a1616..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/JavaParser.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (C) 2008 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; - -import org.checkerframework.stubparser.ast.CompilationUnit; -import org.checkerframework.stubparser.ast.IndexUnit; - -/** - *

This class was generated automatically by javacc, do not edit.

- *

Parse Java 1.5 source code and creates Abstract Syntax Tree classes.

- *

Note: To use this parser asynchronously, disable de parser cache - * by calling the method {@link #setCacheParser} with {@code false} - * as argument.

- * - * @author Júlio Vilmar Gesser - */ -public final class JavaParser { - - private static ASTParser parser; - - private static boolean cacheParser = true; - - private JavaParser() { - // hide the constructor - } - - /** - * Changes the way that the parser acts when starts to parse. If the - * parser cache is enabled, only one insance of this object will be - * used in every call to parse methods. - * If this parser is intend to be used asynchonously, the cache must - * be disabled setting this flag to {@code false}. - * By default, the cache is enabled. - * @param value {@code false} to disable the parser instance cache. - */ - public static void setCacheParser(boolean value) { - cacheParser = value; - if (!value) { - parser = null; - } - } - - /** - * Parses the Java code contained in the {@link InputStream} and returns - * a {@link CompilationUnit} that represents it. - * @param in {@link InputStream} containing Java source code - * @param encoding encoding of the source code - * @return CompilationUnit representing the Java source code - * @throws ParseException if the source code has parser errors - */ - public static IndexUnit parse(InputStream in, String encoding) throws ParseException { - if (cacheParser) { - if (parser == null) { - parser = new ASTParser(in, encoding); - } else { - parser.reset(in, encoding); - } - return parser.IndexUnit(); - } - return new ASTParser(in, encoding).IndexUnit(); - } - - /** - * Parses the Java code contained in the {@link InputStream} and returns - * a {@link CompilationUnit} that represents it. - * @param in {@link InputStream} containing Java source code - * @return CompilationUnit representing the Java source code - * @throws ParseException if the source code has parser errors - */ - public static IndexUnit parse(InputStream in) throws ParseException { - return parse(in, null); - } - - /** - * Parses the Java code contained in a {@link File} and returns - * a {@link CompilationUnit} that represents it. - * @param file {@link File} containing Java source code - * @param encoding encoding of the source code - * @return CompilationUnit representing the Java source code - * @throws ParseException if the source code has parser errors - */ - public static IndexUnit parse(File file, String encoding) throws ParseException, IOException { - FileInputStream in = new FileInputStream(file); - try { - return parse(in, encoding); - } finally { - in.close(); - } - } - - /** - * Parses the Java code contained in a {@link File} and returns - * a {@link CompilationUnit} that represents it. - * @param file {@link File} containing Java source code - * @return CompilationUnit representing the Java source code - * @throws ParseException if the source code has parser errors - */ - public static IndexUnit parse(File file) throws ParseException, IOException { - return parse(file, null); - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ParseException.java b/stubparser/src/org/checkerframework/stubparser/ParseException.java deleted file mode 100644 index d8e7339281c..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ParseException.java +++ /dev/null @@ -1,205 +0,0 @@ -/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 5.0 */ -/* JavaCCOptions:KEEP_LINE_COL=null */ -/* - * Copyright (C) 2008 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -package org.checkerframework.stubparser; - -/** - * This exception is thrown when parse errors are encountered. - * You can explicitly create objects of this exception type by - * calling the method generateParseException in the generated - * parser. - * - * You can modify this class to customize your error reporting - * mechanisms so long as you retain the public fields. - */ -public class ParseException extends Exception { - - /** - * The version identifier for this Serializable class. - * Increment only if the serialized form of the - * class changes. - */ - private static final long serialVersionUID = 1L; - - /** - * This constructor is used by the method "generateParseException" - * in the generated parser. Calling this constructor generates - * a new object of this type with the fields "currentToken", - * "expectedTokenSequences", and "tokenImage" set. - */ - public ParseException(Token currentTokenVal, - int[][] expectedTokenSequencesVal, - String[] tokenImageVal - ) - { - super(initialise(currentTokenVal, expectedTokenSequencesVal, tokenImageVal)); - currentToken = currentTokenVal; - expectedTokenSequences = expectedTokenSequencesVal; - tokenImage = tokenImageVal; - } - - /** - * The following constructors are for use by you for whatever - * purpose you can think of. Constructing the exception in this - * manner makes the exception behave in the normal way -- i.e., as - * documented in the class {@link Throwable}. The fields - * {@link #expectedTokenSequences}, and {@link #tokenImage} do not contain - * relevant information. The JavaCC generated code does not use - * these constructors. - */ - - public ParseException() { - super(); - } - - /** Constructor with message. */ - public ParseException(String message) { - super(message); - } - - - /** - * This is the last token that has been consumed successfully. If - * this object has been created due to a parse error, the token - * followng this token will (therefore) be the first error token. - */ - public Token currentToken; - - /** - * Each entry in this array is an array of integers. Each array - * of integers represents a sequence of tokens (by their ordinal - * values) that is expected at this point of the parse. - */ - public int[][] expectedTokenSequences; - - /** - * This is a reference to the "tokenImage" array of the generated - * parser within which the parse error occurred. This array is - * defined in the generated ...Constants interface. - */ - public String[] tokenImage; - - /** - * It uses "currentToken" and "expectedTokenSequences" to generate a parse - * error message and returns it. If this object has been created - * due to a parse error, and you do not catch it (it gets thrown - * from the parser) the correct error message - * gets displayed. - */ - private static String initialise(Token currentToken, - int[][] expectedTokenSequences, - String[] tokenImage) { - String eol = System.getProperty("line.separator", "\n"); - StringBuffer expected = new StringBuffer(); - int maxSize = 0; - for (int i = 0; i < expectedTokenSequences.length; i++) { - if (maxSize < expectedTokenSequences[i].length) { - maxSize = expectedTokenSequences[i].length; - } - for (int j = 0; j < expectedTokenSequences[i].length; j++) { - expected.append(tokenImage[expectedTokenSequences[i][j]]).append(' '); - } - if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) { - expected.append("..."); - } - expected.append(eol).append(" "); - } - String retval = "Encountered \""; - Token tok = currentToken.next; - for (int i = 0; i < maxSize; i++) { - if (i != 0) retval += " "; - if (tok.kind == 0) { - retval += tokenImage[0]; - break; - } - retval += " " + tokenImage[tok.kind]; - retval += " \""; - retval += add_escapes(tok.image); - retval += " \""; - tok = tok.next; - } - retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn; - retval += "." + eol; - if (expectedTokenSequences.length == 1) { - retval += "Was expecting:" + eol + " "; - } else { - retval += "Was expecting one of:" + eol + " "; - } - retval += expected.toString(); - return retval; - } - - /** - * The end of line string for this machine. - */ - protected String eol = System.getProperty("line.separator", "\n"); - - /** - * Used to convert raw characters to their escaped version - * when these raw version cannot be used as part of an ASCII - * string literal. - */ - static String add_escapes(String str) { - StringBuffer retval = new StringBuffer(); - char ch; - for (int i = 0; i < str.length(); i++) { - switch (str.charAt(i)) - { - case 0 : - continue; - case '\b': - retval.append("\\b"); - continue; - case '\t': - retval.append("\\t"); - continue; - case '\n': - retval.append("\\n"); - continue; - case '\f': - retval.append("\\f"); - continue; - case '\r': - retval.append("\\r"); - continue; - case '\"': - retval.append("\\\""); - continue; - case '\'': - retval.append("\\\'"); - continue; - case '\\': - retval.append("\\\\"); - continue; - default: - if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { - String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); - } else { - retval.append(ch); - } - continue; - } - } - return retval.toString(); - } - -} -/* JavaCC - OriginalChecksum=f5fd9133164106959891595a82a9ae90 (do not edit this line) */ diff --git a/stubparser/src/org/checkerframework/stubparser/Token.java b/stubparser/src/org/checkerframework/stubparser/Token.java deleted file mode 100644 index 81823acd973..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/Token.java +++ /dev/null @@ -1,150 +0,0 @@ -/* Generated By:JavaCC: Do not edit this line. Token.java Version 5.0 */ -/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ -/* - * Copyright (C) 2008 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -package org.checkerframework.stubparser; - -/** - * Describes the input token stream. - */ - -public class Token implements java.io.Serializable { - - /** - * The version identifier for this Serializable class. - * Increment only if the serialized form of the - * class changes. - */ - private static final long serialVersionUID = 1L; - - /** - * An integer that describes the kind of this token. This numbering - * system is determined by JavaCCParser, and a table of these numbers is - * stored in the file ...Constants.java. - */ - public int kind; - - /** The line number of the first character of this Token. */ - public int beginLine; - /** The column number of the first character of this Token. */ - public int beginColumn; - /** The line number of the last character of this Token. */ - public int endLine; - /** The column number of the last character of this Token. */ - public int endColumn; - - /** - * The string image of the token. - */ - public String image; - - /** - * A reference to the next regular (non-special) token from the input - * stream. If this is the last token from the input stream, or if the - * token manager has not read tokens beyond this one, this field is - * set to null. This is true only if this token is also a regular - * token. Otherwise, see below for a description of the contents of - * this field. - */ - public Token next; - - /** - * This field is used to access special tokens that occur prior to this - * token, but after the immediately preceding regular (non-special) token. - * If there are no such special tokens, this field is set to null. - * When there are more than one such special token, this field refers - * to the last of these special tokens, which in turn refers to the next - * previous special token through its specialToken field, and so on - * until the first special token (whose specialToken field is null). - * The next fields of special tokens refer to other special tokens that - * immediately follow it (without an intervening regular token). If there - * is no such token, this field is null. - */ - public Token specialToken; - - /** - * An optional attribute value of the Token. - * Tokens which are not used as syntactic sugar will often contain - * meaningful values that will be used later on by the compiler or - * interpreter. This attribute value is often different from the image. - * Any subclass of Token that actually wants to return a non-null value can - * override this method as appropriate. - */ - public Object getValue() { - return null; - } - - /** - * No-argument constructor - */ - public Token() {} - - /** - * Constructs a new token for the specified Image. - */ - public Token(int kind) - { - this(kind, null); - } - - /** - * Constructs a new token for the specified Image and Kind. - */ - public Token(int kind, String image) - { - this.kind = kind; - this.image = image; - } - - /** - * Returns the image. - */ - @Override - public String toString() - { - return image; - } - - /** - * Returns a new Token object, by default. However, if you want, you - * can create and return subclass objects based on the value of ofKind. - * Simply add the cases to the switch for all those special cases. - * For example, if you have a subclass of Token called IDToken that - * you want to create if ofKind is ID, simply add something like : - * - *
case MyParserConstants.ID : return new IDToken(ofKind, image);
- * - * to the following switch statement. Then you can cast matchedToken - * variable to the appropriate type and use sit in your lexical actions. - */ - public static Token newToken(int ofKind, String image) - { - switch(ofKind) - { - default : return new Token(ofKind, image); - } - } - - public static Token newToken(int ofKind) - { - return newToken(ofKind, null); - } - -} -/* JavaCC - OriginalChecksum=560de154774da347a5578272cd7d5ec0 (do not edit this line) */ diff --git a/stubparser/src/org/checkerframework/stubparser/TokenMgrError.java b/stubparser/src/org/checkerframework/stubparser/TokenMgrError.java deleted file mode 100644 index b52c24d00d9..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/TokenMgrError.java +++ /dev/null @@ -1,166 +0,0 @@ -/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 5.0 */ -/* JavaCCOptions: */ -/* - * Copyright (C) 2008 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -package org.checkerframework.stubparser; - -/** Token Manager Error. */ -public class TokenMgrError extends Error -{ - - /** - * The version identifier for this Serializable class. - * Increment only if the serialized form of the - * class changes. - */ - private static final long serialVersionUID = 1L; - - /* - * Ordinals for various reasons why an Error of this type can be thrown. - */ - - /** - * Lexical error occurred. - */ - static final int LEXICAL_ERROR = 0; - - /** - * An attempt was made to create a second instance of a static token manager. - */ - static final int STATIC_LEXER_ERROR = 1; - - /** - * Tried to change to an invalid lexical state. - */ - static final int INVALID_LEXICAL_STATE = 2; - - /** - * Detected (and bailed out of) an infinite loop in the token manager. - */ - static final int LOOP_DETECTED = 3; - - /** - * Indicates the reason why the exception is thrown. It will have - * one of the above 4 values. - */ - int errorCode; - - /** - * Replaces unprintable characters by their escaped (or unicode escaped) - * equivalents in the given string - */ - protected static final String addEscapes(String str) { - StringBuffer retval = new StringBuffer(); - char ch; - for (int i = 0; i < str.length(); i++) { - switch (str.charAt(i)) - { - case 0 : - continue; - case '\b': - retval.append("\\b"); - continue; - case '\t': - retval.append("\\t"); - continue; - case '\n': - retval.append("\\n"); - continue; - case '\f': - retval.append("\\f"); - continue; - case '\r': - retval.append("\\r"); - continue; - case '\"': - retval.append("\\\""); - continue; - case '\'': - retval.append("\\\'"); - continue; - case '\\': - retval.append("\\\\"); - continue; - default: - if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { - String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); - } else { - retval.append(ch); - } - continue; - } - } - return retval.toString(); - } - - /** - * Returns a detailed message for the Error when it is thrown by the - * token manager to indicate a lexical error. - * Parameters : - * EOFSeen : indicates if EOF caused the lexical error - * curLexState : lexical state in which this error occurred - * errorLine : line number when the error occurred - * errorColumn : column number when the error occurred - * errorAfter : prefix that was seen before this error occurred - * curchar : the offending character - * Note: You can customize the lexical error message by modifying this method. - */ - protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) { - return("Lexical error at line " + - errorLine + ", column " + - errorColumn + ". Encountered: " + - (EOFSeen ? " " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") + - "after : \"" + addEscapes(errorAfter) + "\""); - } - - /** - * You can also modify the body of this method to customize your error messages. - * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not - * of end-users concern, so you can return something like : - * - * "Internal Error : Please file a bug report .... " - * - * from this method for such cases in the release version of your parser. - */ - @Override - public String getMessage() { - return super.getMessage(); - } - - /* - * Constructors of various flavors follow. - */ - - /** No arg constructor. */ - public TokenMgrError() { - } - - /** Constructor with message and reason. */ - public TokenMgrError(String message, int reason) { - super(message); - errorCode = reason; - } - - /** Full Constructor. */ - public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) { - this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason); - } -} -/* JavaCC - OriginalChecksum=a627342c87c087822f913ab7293c280e (do not edit this line) */ diff --git a/stubparser/src/org/checkerframework/stubparser/ast/BlockComment.java b/stubparser/src/org/checkerframework/stubparser/ast/BlockComment.java deleted file mode 100644 index 8c4d8463d27..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/BlockComment.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 23/05/2008 - */ -package org.checkerframework.stubparser.ast; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - *

- * AST node that represent block comments. - *

- * Block comments can has multi lines and are delimited by "/*" and - * "*/". - * - * @author Julio Vilmar Gesser - */ -public final class BlockComment extends Comment { - - public BlockComment() { - } - - public BlockComment(String content) { - super(content); - } - - public BlockComment(int beginLine, int beginColumn, int endLine, int endColumn, String content) { - super(beginLine, beginColumn, endLine, endColumn, content); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/Comment.java b/stubparser/src/org/checkerframework/stubparser/ast/Comment.java deleted file mode 100644 index bdcb2fe0def..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/Comment.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 23/05/2008 - */ -package org.checkerframework.stubparser.ast; - -import org.checkerframework.stubparser.ast.body.JavadocComment; - -/** - * Abstract class for all AST nodes that represent comments. - * - * @see BlockComment - * @see LineComment - * @see JavadocComment - * @author Julio Vilmar Gesser - */ -public abstract class Comment extends Node { - - private String content; - - public Comment() { - } - - public Comment(String content) { - this.content = content; - } - - public Comment(int beginLine, int beginColumn, int endLine, int endColumn, String content) { - super(beginLine, beginColumn, endLine, endColumn); - this.content = content; - } - - /** - * Return the text of the comment. - * - * @return text of the comment - */ - public final String getContent() { - return content; - } - - /** - * Sets the text of the comment. - * - * @param content - * the text of the comment to set - */ - public void setContent(String content) { - this.content = content; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/CompilationUnit.java b/stubparser/src/org/checkerframework/stubparser/ast/CompilationUnit.java deleted file mode 100644 index e41b4b688d8..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/CompilationUnit.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast; - -import java.util.List; - -import org.checkerframework.stubparser.ast.body.AnnotationDeclaration; -import org.checkerframework.stubparser.ast.body.ClassOrInterfaceDeclaration; -import org.checkerframework.stubparser.ast.body.EmptyTypeDeclaration; -import org.checkerframework.stubparser.ast.body.EnumDeclaration; -import org.checkerframework.stubparser.ast.body.JavadocComment; -import org.checkerframework.stubparser.ast.body.TypeDeclaration; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - *

- * This class represents the entire compilation unit. Each java file denotes a - * compilation unit. - *

- * The CompilationUnit is constructed following the syntax:
- * - * - * - * - * - * - *
CompilationUnit::= - * ( {@link PackageDeclaration} )?
- * ( {@link ImportDeclaration} )*
- * ( {@link TypeDeclaration} )*
- *
- * - * @author Julio Vilmar Gesser - */ -public final class CompilationUnit extends Node { - - private PackageDeclaration pakage; - - private List imports; - - private List types; - - private List comments; - - public CompilationUnit() { - } - - public CompilationUnit(PackageDeclaration pakage, List imports, List types, List comments) { - this.pakage = pakage; - this.imports = imports; - this.types = types; - this.comments = comments; - } - - public CompilationUnit(int beginLine, int beginColumn, int endLine, int endColumn, PackageDeclaration pakage, List imports, List types, List comments) { - super(beginLine, beginColumn, endLine, endColumn); - this.pakage = pakage; - this.imports = imports; - this.types = types; - this.comments = comments; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public
void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - /** - * Return a list containing all comments declared in this compilation unit. - * Including javadocs, line comments and block comments of all types, - * inner-classes and other members.
- * If there is no comment, {@code null} is returned. - * - * @return list with all comments of this compilation unit or - * {@code null} - * @see JavadocComment - * @see LineComment - * @see BlockComment - */ - public List getComments() { - return comments; - } - - /** - * Retrieves the list of imports declared in this compilation unit or - * {@code null} if there is no import. - * - * @return the list of imports or {@code null} if there is no import - */ - public List getImports() { - return imports; - } - - /** - * Retrieves the package declaration of this compilation unit.
- * If this compilation unit has no package declaration (default package), - * {@code null} is returned. - * - * @return the package declaration or {@code null} - */ - public PackageDeclaration getPackage() { - return pakage; - } - - /** - * Return the list of types declared in this compilation unit.
- * If there is no types declared, {@code null} is returned. - * - * @return the list of types or {@code null} null if there is no type - * @see AnnotationDeclaration - * @see ClassOrInterfaceDeclaration - * @see EmptyTypeDeclaration - * @see EnumDeclaration - */ - public List getTypes() { - return types; - } - - /** - * Sets the list of comments of this compilation unit. - * - * @param comments - * the list of comments - */ - public void setComments(List comments) { - this.comments = comments; - } - - /** - * Sets the list of imports of this compilation unit. The list is initially - * {@code null}. - * - * @param imports - * the list of imports - */ - public void setImports(List imports) { - this.imports = imports; - } - - /** - * Sets or clear the package declarations of this compilation unit. - * - * @param pakage - * the pakage declaration to set or {@code null} to default - * package - */ - public void setPackage(PackageDeclaration pakage) { - this.pakage = pakage; - } - - /** - * Sets the list of types declared in this compilation unit. - * - * @param types - * the lis of types - */ - public void setTypes(List types) { - this.types = types; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/ImportDeclaration.java b/stubparser/src/org/checkerframework/stubparser/ast/ImportDeclaration.java deleted file mode 100644 index 037f54f4eba..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/ImportDeclaration.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast; - -import org.checkerframework.stubparser.ast.expr.NameExpr; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - *

- * This class represents a import declaration. Imports are optional for the - * {@link CompilationUnit}. - *

- * The ImportDeclaration is constructed following the syntax:
- * - * - * - * - * - * - *
ImportDeclaration::= - * "import" ( "static" )? {@link NameExpr} ( "." "*" )? ";" - *
- * - * @author Julio Vilmar Gesser - */ -public final class ImportDeclaration extends Node { - - private NameExpr name; - - private boolean static_; - - private boolean asterisk; - - public ImportDeclaration() { - } - - public ImportDeclaration(NameExpr name, boolean isStatic, boolean isAsterisk) { - this.name = name; - this.static_ = isStatic; - this.asterisk = isAsterisk; - } - - public ImportDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, NameExpr name, boolean isStatic, boolean isAsterisk) { - super(beginLine, beginColumn, endLine, endColumn); - this.name = name; - this.static_ = isStatic; - this.asterisk = isAsterisk; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public
void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - /** - * Retrieves the name of the import. - * - * @return the name of the import - */ - public NameExpr getName() { - return name; - } - - /** - * Return if the import ends with "*". - * - * @return {@code true} if the import ends with "*", {@code false} - * otherwise - */ - public boolean isAsterisk() { - return asterisk; - } - - /** - * Return if the import is static. - * - * @return {@code true} if the import is static, {@code false} - * otherwise - */ - public boolean isStatic() { - return static_; - } - - /** - * Sets if this import is asterisk. - * - * @param asterisk - * {@code true} if this import is asterisk - */ - public void setAsterisk(boolean asterisk) { - this.asterisk = asterisk; - } - - /** - * Sets the name this import. - * - * @param name - * the name to set - */ - public void setName(NameExpr name) { - this.name = name; - } - - /** - * Sets if this import is static. - * - * @param static_ - * {@code true} if this import is static - */ - public void setStatic(boolean static_) { - this.static_ = static_; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/IndexUnit.java b/stubparser/src/org/checkerframework/stubparser/ast/IndexUnit.java deleted file mode 100644 index d25b5beb534..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/IndexUnit.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.checkerframework.stubparser.ast; - -import java.util.List; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -public class IndexUnit extends Node { - List compilationUnits; - - public IndexUnit(List compilationUnits) { - this.compilationUnits = compilationUnits; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public List getCompilationUnits() { - return this.compilationUnits; - } - - public void setCompilationUnit(List compilationUnits) { - this.compilationUnits = compilationUnits; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/LineComment.java b/stubparser/src/org/checkerframework/stubparser/ast/LineComment.java deleted file mode 100644 index 44bf99fbca8..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/LineComment.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 23/05/2008 - */ -package org.checkerframework.stubparser.ast; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - *

- * AST node that represent line comments. - *

- * Line comments are started with "//" and finish at the end of the line ("\n"). - * - * @author Julio Vilmar Gesser - */ -public final class LineComment extends Comment { - - public LineComment() { - } - - public LineComment(String content) { - super(content); - } - - public LineComment(int beginLine, int beginColumn, int endLine, int endColumn, String content) { - super(beginLine, beginColumn, endLine, endColumn, content); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public
void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/Node.java b/stubparser/src/org/checkerframework/stubparser/ast/Node.java deleted file mode 100644 index 374c926668b..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/Node.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast; - -/*>>> -import org.checkerframework.dataflow.qual.Pure; -import org.checkerframework.dataflow.qual.SideEffectFree; -*/ - -import org.checkerframework.stubparser.ast.visitor.DumpVisitor; -import org.checkerframework.stubparser.ast.visitor.EqualsVisitor; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * Abstract class for all nodes of the AST. - * - * @author Julio Vilmar Gesser - */ -public abstract class Node { - - private int beginLine; - - private int beginColumn; - - private int endLine; - - private int endColumn; - - /** - * This attribute can store additional information from semantic analysis. - */ - private Object data; - - public Node() { - } - - public Node(int beginLine, int beginColumn, int endLine, int endColumn) { - this.beginLine = beginLine; - this.beginColumn = beginColumn; - this.endLine = endLine; - this.endColumn = endColumn; - } - - /** - * Accept method for visitor support. - * - * @param - * the type the return value of the visitor - * @param - * the type the argument passed for the visitor - * @param v - * the visitor implementation - * @param arg - * any value relevant for the visitor - * @return the result of the visit - */ - public abstract R accept(GenericVisitor v, A arg); - - /** - * Accept method for visitor support. - * - * @param - * the type the argument passed for the visitor - * @param v - * the visitor implementation - * @param arg - * any value relevant for the visitor - */ - public abstract void accept(VoidVisitor v, A arg); - - /** - * Return the begin column of this node. - * - * @return the begin column of this node - */ - public final int getBeginColumn() { - return beginColumn; - } - - /** - * Return the begin line of this node. - * - * @return the begin line of this node - */ - public final int getBeginLine() { - return beginLine; - } - - /** - * Use this to retrieve additional information associated to this node. - */ - public final Object getData() { - return data; - } - - /** - * Return the end column of this node. - * - * @return the end column of this node - */ - public final int getEndColumn() { - return endColumn; - } - - /** - * Return the end line of this node. - * - * @return the end line of this node - */ - public final int getEndLine() { - return endLine; - } - - /** - * Sets the begin column of this node. - * - * @param beginColumn - * the begin column of this node - */ - public final void setBeginColumn(int beginColumn) { - this.beginColumn = beginColumn; - } - - /** - * Sets the begin line of this node. - * - * @param beginLine - * the begin line of this node - */ - public final void setBeginLine(int beginLine) { - this.beginLine = beginLine; - } - - /** - * Use this to store additional information to this node. - */ - public final void setData(Object data) { - this.data = data; - } - - /** - * Sets the end column of this node. - * - * @param endColumn - * the end column of this node - */ - public final void setEndColumn(int endColumn) { - this.endColumn = endColumn; - } - - /** - * Sets the end line of this node. - * - * @param endLine - * the end line of this node - */ - public final void setEndLine(int endLine) { - this.endLine = endLine; - } - - /** - * Return the String representation of this node. - * - * @return the String representation of this node - */ - /*@SideEffectFree*/ - @Override - public final String toString() { - DumpVisitor visitor = new DumpVisitor(); - accept(visitor, null); - return visitor.getSource(); - } - - /*@Pure*/ - @Override - public final int hashCode() { - return toString().hashCode(); - } - - @Override - public boolean equals(Object obj) { - return EqualsVisitor.equals(this, (Node) obj); - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/PackageDeclaration.java b/stubparser/src/org/checkerframework/stubparser/ast/PackageDeclaration.java deleted file mode 100644 index 5cd0b4b6dd3..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/PackageDeclaration.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 17/10/2007 - */ -package org.checkerframework.stubparser.ast; - -import java.util.List; - -import org.checkerframework.stubparser.ast.expr.AnnotationExpr; -import org.checkerframework.stubparser.ast.expr.NameExpr; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - *

- * This class represents the package declaration. The package declaration is - * optional for the {@link CompilationUnit}. - *

- * The PackageDeclaration is constructed following the syntax:
- * - * - * - * - * - * - *
PackageDeclaration::= - * ( {@link AnnotationExpr} )* "package" {@link NameExpr} ) ";" - *
- * - * @author Julio Vilmar Gesser - */ -public final class PackageDeclaration extends Node { - - private List annotations; - - private NameExpr name; - - public PackageDeclaration() { - } - - public PackageDeclaration(NameExpr name) { - this.name = name; - } - - public PackageDeclaration(List annotations, NameExpr name) { - this.annotations = annotations; - this.name = name; - } - - public PackageDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, List annotations, NameExpr name) { - super(beginLine, beginColumn, endLine, endColumn); - this.annotations = annotations; - this.name = name; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public
void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - /** - * Retrieves the list of annotations declared before the package - * declaration. Return {@code null} if there are no annotations. - * - * @return list of annotations or {@code null} - */ - public List getAnnotations() { - return annotations; - } - - /** - * Return the name of the package. - * - * @return the name of the package - */ - public NameExpr getName() { - return name; - } - - /** - * @param annotations - * the annotations to set - */ - public void setAnnotations(List annotations) { - this.annotations = annotations; - } - - /** - * Sets the name of this package declaration. - * - * @param name - * the name to set - */ - public void setName(NameExpr name) { - this.name = name; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/TypeParameter.java b/stubparser/src/org/checkerframework/stubparser/ast/TypeParameter.java deleted file mode 100644 index e822384e324..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/TypeParameter.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast; - -import java.util.List; - -import org.checkerframework.stubparser.ast.expr.AnnotationExpr; -import org.checkerframework.stubparser.ast.type.ClassOrInterfaceType; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - *

- * This class represents the declaration of a genetics argument. - *

- * The TypeParameter is constructed following the syntax:
- * - * - * - * - * - * - *
TypeParameter::= - * <IDENTIFIER> ( "extends" {@link ClassOrInterfaceType} ( "&" {@link ClassOrInterfaceType} )* )? - *
- * - * @author Julio Vilmar Gesser - */ -public final class TypeParameter extends Node { - - private String name; - - private List annotations; - - private List typeBound; - - public TypeParameter() { - } - - public TypeParameter(String name, List annotations, List typeBound) { - this.name = name; - this.annotations = annotations; - this.typeBound = typeBound; - } - - public TypeParameter(int beginLine, int beginColumn, int endLine, int endColumn, String name, List annotations, List typeBound) { - super(beginLine, beginColumn, endLine, endColumn); - this.name = name; - this.annotations = annotations; - this.typeBound = typeBound; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public
void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - /** - * Return the name of the paramenter. - * - * @return the name of the paramenter - */ - public String getName() { - return name; - } - - /** - * Return the list of {@link ClassOrInterfaceType} that this parameter - * extends. Return {@code null} null if there are no type. - * - * @return list of types that this paramente extends or {@code null} - */ - public List getTypeBound() { - return typeBound; - } - - /** - * Sets the name of this type parameter. - * - * @param name - * the name to set - */ - public void setName(String name) { - this.name = name; - } - - /** - * Sets the list o types. - * - * @param typeBound - * the typeBound to set - */ - public void setTypeBound(List typeBound) { - this.typeBound = typeBound; - } - - public List getAnnotations() { - return annotations; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/body/AnnotationDeclaration.java b/stubparser/src/org/checkerframework/stubparser/ast/body/AnnotationDeclaration.java deleted file mode 100644 index 3e9212ad064..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/body/AnnotationDeclaration.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 21/11/2006 - */ -package org.checkerframework.stubparser.ast.body; - -import java.util.List; - -import org.checkerframework.stubparser.ast.expr.AnnotationExpr; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class AnnotationDeclaration extends TypeDeclaration { - - public AnnotationDeclaration() { - } - - public AnnotationDeclaration(int modifiers, String name) { - super(modifiers, name); - } - - public AnnotationDeclaration(JavadocComment javaDoc, int modifiers, List annotations, String name, List members) { - super(annotations, javaDoc, modifiers, name, members); - } - - public AnnotationDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc, int modifiers, List annotations, String name, List members) { - super(beginLine, beginColumn, endLine, endColumn, annotations, javaDoc, modifiers, name, members); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/body/AnnotationMemberDeclaration.java b/stubparser/src/org/checkerframework/stubparser/ast/body/AnnotationMemberDeclaration.java deleted file mode 100644 index 29fd6ee8b5b..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/body/AnnotationMemberDeclaration.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 21/11/2006 - */ -package org.checkerframework.stubparser.ast.body; - -import java.util.List; - -import org.checkerframework.stubparser.ast.expr.AnnotationExpr; -import org.checkerframework.stubparser.ast.expr.Expression; -import org.checkerframework.stubparser.ast.type.Type; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class AnnotationMemberDeclaration extends BodyDeclaration { - - private int modifiers; - - private Type type; - - private String name; - - private Expression defaultValue; - - public AnnotationMemberDeclaration() { - } - - public AnnotationMemberDeclaration(int modifiers, Type type, String name, Expression defaultValue) { - this.modifiers = modifiers; - this.type = type; - this.name = name; - this.defaultValue = defaultValue; - } - - public AnnotationMemberDeclaration(JavadocComment javaDoc, int modifiers, List annotations, Type type, String name, Expression defaultValue) { - super(annotations, javaDoc); - this.modifiers = modifiers; - this.type = type; - this.name = name; - this.defaultValue = defaultValue; - } - - public AnnotationMemberDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc, int modifiers, List annotations, Type type, String name, Expression defaultValue) { - super(beginLine, beginColumn, endLine, endColumn, annotations, javaDoc); - this.modifiers = modifiers; - this.type = type; - this.name = name; - this.defaultValue = defaultValue; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getDefaultValue() { - return defaultValue; - } - - /** - * Return the modifiers of this member declaration. - * - * @see ModifierSet - * @return modifiers - */ - public int getModifiers() { - return modifiers; - } - - public String getName() { - return name; - } - - public Type getType() { - return type; - } - - public void setDefaultValue(Expression defaultValue) { - this.defaultValue = defaultValue; - } - - public void setModifiers(int modifiers) { - this.modifiers = modifiers; - } - - public void setName(String name) { - this.name = name; - } - - public void setType(Type type) { - this.type = type; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/body/BodyDeclaration.java b/stubparser/src/org/checkerframework/stubparser/ast/body/BodyDeclaration.java deleted file mode 100644 index 203af8d5593..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/body/BodyDeclaration.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.body; - -import java.util.List; - -import org.checkerframework.stubparser.ast.Node; -import org.checkerframework.stubparser.ast.expr.AnnotationExpr; - -/** - * @author Julio Vilmar Gesser - */ -public abstract class BodyDeclaration extends Node { - - private JavadocComment javaDoc; - - private List annotations; - - public BodyDeclaration() { - } - - public BodyDeclaration(List annotations, JavadocComment javaDoc) { - this.javaDoc = javaDoc; - this.annotations = annotations; - } - - public BodyDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, List annotations, JavadocComment javaDoc) { - super(beginLine, beginColumn, endLine, endColumn); - this.javaDoc = javaDoc; - this.annotations = annotations; - } - - public final JavadocComment getJavaDoc() { - return javaDoc; - } - - public final List getAnnotations() { - return annotations; - } - - public final void setJavaDoc(JavadocComment javaDoc) { - this.javaDoc = javaDoc; - } - - public final void setAnnotations(List annotations) { - this.annotations = annotations; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/body/ClassOrInterfaceDeclaration.java b/stubparser/src/org/checkerframework/stubparser/ast/body/ClassOrInterfaceDeclaration.java deleted file mode 100644 index e736d5d380f..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/body/ClassOrInterfaceDeclaration.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.body; - -import java.util.List; - -import org.checkerframework.stubparser.ast.TypeParameter; -import org.checkerframework.stubparser.ast.expr.AnnotationExpr; -import org.checkerframework.stubparser.ast.type.ClassOrInterfaceType; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class ClassOrInterfaceDeclaration extends TypeDeclaration { - - private boolean interface_; - - private List typeParameters; - - private List extendsList; - - private List implementsList; - - public ClassOrInterfaceDeclaration() { - } - - public ClassOrInterfaceDeclaration(int modifiers, boolean isInterface, String name) { - super(modifiers, name); - this.interface_ = isInterface; - } - - public ClassOrInterfaceDeclaration(JavadocComment javaDoc, int modifiers, List annotations, boolean isInterface, String name, List typeParameters, List extendsList, List implementsList, List members) { - super(annotations, javaDoc, modifiers, name, members); - this.interface_ = isInterface; - this.typeParameters = typeParameters; - this.extendsList = extendsList; - this.implementsList = implementsList; - } - - public ClassOrInterfaceDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc, int modifiers, List annotations, boolean isInterface, String name, List typeParameters, List extendsList, List implementsList, List members) { - super(beginLine, beginColumn, endLine, endColumn, annotations, javaDoc, modifiers, name, members); - this.interface_ = isInterface; - this.typeParameters = typeParameters; - this.extendsList = extendsList; - this.implementsList = implementsList; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public List getExtends() { - return extendsList; - } - - public List getImplements() { - return implementsList; - } - - public List getTypeParameters() { - return typeParameters; - } - - public boolean isInterface() { - return interface_; - } - - public void setExtends(List extendsList) { - this.extendsList = extendsList; - } - - public void setImplements(List implementsList) { - this.implementsList = implementsList; - } - - public void setInterface(boolean interface_) { - this.interface_ = interface_; - } - - public void setTypeParameters(List typeParameters) { - this.typeParameters = typeParameters; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/body/ConstructorDeclaration.java b/stubparser/src/org/checkerframework/stubparser/ast/body/ConstructorDeclaration.java deleted file mode 100644 index 9269f845f66..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/body/ConstructorDeclaration.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.body; - -import java.util.List; - -import org.checkerframework.stubparser.ast.TypeParameter; -import org.checkerframework.stubparser.ast.expr.AnnotationExpr; -import org.checkerframework.stubparser.ast.expr.NameExpr; -import org.checkerframework.stubparser.ast.stmt.BlockStmt; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class ConstructorDeclaration extends BodyDeclaration { - - private int modifiers; - - private List typeParameters; - - private String name; - - private List parameters; - - private List receiverAnnotations; - - private List throws_; - - private BlockStmt block; - - public ConstructorDeclaration() { - } - - public ConstructorDeclaration(int modifiers, String name) { - this.modifiers = modifiers; - this.name = name; - } - - public ConstructorDeclaration(JavadocComment javaDoc, int modifiers, List annotations, List typeParameters, String name, List parameters, List throws_, BlockStmt block) { - super(annotations, javaDoc); - this.modifiers = modifiers; - this.typeParameters = typeParameters; - this.name = name; - this.parameters = parameters; - this.throws_ = throws_; - this.block = block; - } - - public ConstructorDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc, int modifiers, List annotations, List typeParameters, String name, List parameters, List receiverAnnotations, List throws_, BlockStmt block) { - super(beginLine, beginColumn, endLine, endColumn, annotations, javaDoc); - this.modifiers = modifiers; - this.typeParameters = typeParameters; - this.name = name; - this.parameters = parameters; - this.receiverAnnotations = receiverAnnotations; - this.throws_ = throws_; - this.block = block; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public BlockStmt getBlock() { - return block; - } - - /** - * Return the modifiers of this member declaration. - * - * @see ModifierSet - * @return modifiers - */ - public int getModifiers() { - return modifiers; - } - - public String getName() { - return name; - } - - public List getParameters() { - return parameters; - } - - public List getReceiverAnnotations() { - return receiverAnnotations; - } - - public List getThrows() { - return throws_; - } - - public List getTypeParameters() { - return typeParameters; - } - - public void setBlock(BlockStmt block) { - this.block = block; - } - - public void setModifiers(int modifiers) { - this.modifiers = modifiers; - } - - public void setName(String name) { - this.name = name; - } - - public void setParameters(List parameters) { - this.parameters = parameters; - } - - public void setReceiverAnnotations(List receiverAnnotations) { - this.receiverAnnotations = receiverAnnotations; - } - - public void setThrows(List throws_) { - this.throws_ = throws_; - } - - public void setTypeParameters(List typeParameters) { - this.typeParameters = typeParameters; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/body/EmptyMemberDeclaration.java b/stubparser/src/org/checkerframework/stubparser/ast/body/EmptyMemberDeclaration.java deleted file mode 100644 index d3901fbcdee..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/body/EmptyMemberDeclaration.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 07/11/2006 - */ -package org.checkerframework.stubparser.ast.body; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class EmptyMemberDeclaration extends BodyDeclaration { - - public EmptyMemberDeclaration() { - } - - public EmptyMemberDeclaration(JavadocComment javaDoc) { - super(null, javaDoc); - } - - public EmptyMemberDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc) { - super(beginLine, beginColumn, endLine, endColumn, null, javaDoc); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/body/EmptyTypeDeclaration.java b/stubparser/src/org/checkerframework/stubparser/ast/body/EmptyTypeDeclaration.java deleted file mode 100644 index fa19c0f05b8..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/body/EmptyTypeDeclaration.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 20/01/2007 - */ -package org.checkerframework.stubparser.ast.body; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class EmptyTypeDeclaration extends TypeDeclaration { - - public EmptyTypeDeclaration() { - } - - public EmptyTypeDeclaration(JavadocComment javaDoc) { - super(null, javaDoc, 0, null, null); - } - - public EmptyTypeDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc) { - super(beginLine, beginColumn, endLine, endColumn, null, javaDoc, 0, null, null); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/body/EnumConstantDeclaration.java b/stubparser/src/org/checkerframework/stubparser/ast/body/EnumConstantDeclaration.java deleted file mode 100644 index d0e73e2af52..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/body/EnumConstantDeclaration.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/11/2006 - */ -package org.checkerframework.stubparser.ast.body; - -import java.util.List; - -import org.checkerframework.stubparser.ast.expr.AnnotationExpr; -import org.checkerframework.stubparser.ast.expr.Expression; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class EnumConstantDeclaration extends BodyDeclaration { - - private String name; - - private List args; - - private List classBody; - - public EnumConstantDeclaration() { - } - - public EnumConstantDeclaration(String name) { - this.name = name; - } - - public EnumConstantDeclaration(JavadocComment javaDoc, List annotations, String name, List args, List classBody) { - super(annotations, javaDoc); - this.name = name; - this.args = args; - this.classBody = classBody; - } - - public EnumConstantDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc, List annotations, String name, List args, List classBody) { - super(beginLine, beginColumn, endLine, endColumn, annotations, javaDoc); - this.name = name; - this.args = args; - this.classBody = classBody; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public List getArgs() { - return args; - } - - public List getClassBody() { - return classBody; - } - - public String getName() { - return name; - } - - public void setArgs(List args) { - this.args = args; - } - - public void setClassBody(List classBody) { - this.classBody = classBody; - } - - public void setName(String name) { - this.name = name; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/body/EnumDeclaration.java b/stubparser/src/org/checkerframework/stubparser/ast/body/EnumDeclaration.java deleted file mode 100644 index ab49a40e831..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/body/EnumDeclaration.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.body; - -import java.util.List; - -import org.checkerframework.stubparser.ast.expr.AnnotationExpr; -import org.checkerframework.stubparser.ast.type.ClassOrInterfaceType; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class EnumDeclaration extends TypeDeclaration { - - private List implementsList; - - private List entries; - - public EnumDeclaration() { - } - - public EnumDeclaration(int modifiers, String name) { - super(modifiers, name); - } - - public EnumDeclaration(JavadocComment javaDoc, int modifiers, List annotations, String name, List implementsList, List entries, List members) { - super(annotations, javaDoc, modifiers, name, members); - this.implementsList = implementsList; - this.entries = entries; - } - - public EnumDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc, int modifiers, List annotations, String name, List implementsList, List entries, List members) { - super(beginLine, beginColumn, endLine, endColumn, annotations, javaDoc, modifiers, name, members); - this.implementsList = implementsList; - this.entries = entries; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public List getEntries() { - return entries; - } - - public List getImplements() { - return implementsList; - } - - public void setEntries(List entries) { - this.entries = entries; - } - - public void setImplements(List implementsList) { - this.implementsList = implementsList; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/body/FieldDeclaration.java b/stubparser/src/org/checkerframework/stubparser/ast/body/FieldDeclaration.java deleted file mode 100644 index 325cc09d683..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/body/FieldDeclaration.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.body; - -import java.util.ArrayList; -import java.util.List; - -import org.checkerframework.stubparser.ast.expr.AnnotationExpr; -import org.checkerframework.stubparser.ast.type.Type; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class FieldDeclaration extends BodyDeclaration { - - private int modifiers; - - private Type type; - - private List variables; - - public FieldDeclaration() { - } - - public FieldDeclaration(int modifiers, Type type, VariableDeclarator variable) { - this.modifiers = modifiers; - this.type = type; - this.variables = new ArrayList(); - this.variables.add(variable); - } - - public FieldDeclaration(int modifiers, Type type, List variables) { - this.modifiers = modifiers; - this.type = type; - this.variables = variables; - } - - public FieldDeclaration(JavadocComment javaDoc, int modifiers, List annotations, Type type, List variables) { - super(annotations, javaDoc); - this.modifiers = modifiers; - this.type = type; - this.variables = variables; - } - - public FieldDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc, int modifiers, List annotations, Type type, List variables) { - super(beginLine, beginColumn, endLine, endColumn, annotations, javaDoc); - this.modifiers = modifiers; - this.type = type; - this.variables = variables; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - /** - * Return the modifiers of this member declaration. - * - * @see ModifierSet - * @return modifiers - */ - public int getModifiers() { - return modifiers; - } - - public Type getType() { - return type; - } - - public List getVariables() { - return variables; - } - - public void setModifiers(int modifiers) { - this.modifiers = modifiers; - } - - public void setType(Type type) { - this.type = type; - } - - public void setVariables(List variables) { - this.variables = variables; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/body/InitializerDeclaration.java b/stubparser/src/org/checkerframework/stubparser/ast/body/InitializerDeclaration.java deleted file mode 100644 index 90fa36d1b08..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/body/InitializerDeclaration.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 07/11/2006 - */ -package org.checkerframework.stubparser.ast.body; - -import org.checkerframework.stubparser.ast.stmt.BlockStmt; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class InitializerDeclaration extends BodyDeclaration { - - private boolean isStatic; - - private BlockStmt block; - - public InitializerDeclaration() { - } - - public InitializerDeclaration(boolean isStatic, BlockStmt block) { - this.isStatic = isStatic; - this.block = block; - } - - public InitializerDeclaration(JavadocComment javaDoc, boolean isStatic, BlockStmt block) { - super(null, javaDoc); - this.isStatic = isStatic; - this.block = block; - } - - public InitializerDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc, boolean isStatic, BlockStmt block) { - super(beginLine, beginColumn, endLine, endColumn, null, javaDoc); - this.isStatic = isStatic; - this.block = block; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public BlockStmt getBlock() { - return block; - } - - public boolean isStatic() { - return isStatic; - } - - public void setBlock(BlockStmt block) { - this.block = block; - } - - public void setStatic(boolean isStatic) { - this.isStatic = isStatic; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/body/JavadocComment.java b/stubparser/src/org/checkerframework/stubparser/ast/body/JavadocComment.java deleted file mode 100644 index 2fcdbf45430..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/body/JavadocComment.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 23/05/2008 - */ -package org.checkerframework.stubparser.ast.body; - -import org.checkerframework.stubparser.ast.Comment; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class JavadocComment extends Comment { - - public JavadocComment() { - } - - public JavadocComment(String content) { - super(content); - } - - public JavadocComment(int beginLine, int beginColumn, int endLine, int endColumn, String content) { - super(beginLine, beginColumn, endLine, endColumn, content); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/body/MethodDeclaration.java b/stubparser/src/org/checkerframework/stubparser/ast/body/MethodDeclaration.java deleted file mode 100644 index 03ace6e41dc..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/body/MethodDeclaration.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.body; - -import java.util.List; - -import org.checkerframework.stubparser.ast.TypeParameter; -import org.checkerframework.stubparser.ast.expr.AnnotationExpr; -import org.checkerframework.stubparser.ast.expr.NameExpr; -import org.checkerframework.stubparser.ast.stmt.BlockStmt; -import org.checkerframework.stubparser.ast.type.Type; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class MethodDeclaration extends BodyDeclaration { - - private int modifiers; - - private List typeParameters; - - private Type type; - - private String name; - - private List parameters; - - private List receiverAnnotations; - - private int arrayCount; - - private List throws_; - - private BlockStmt body; - - public MethodDeclaration() { - } - - public MethodDeclaration(int modifiers, Type type, String name) { - this.modifiers = modifiers; - this.type = type; - this.name = name; - } - - public MethodDeclaration(int modifiers, Type type, String name, List parameters) { - this.modifiers = modifiers; - this.type = type; - this.name = name; - this.parameters = parameters; - } - - public MethodDeclaration(JavadocComment javaDoc, int modifiers, List annotations, List typeParameters, Type type, String name, List parameters, int arrayCount, List throws_, BlockStmt block) { - super(annotations, javaDoc); - this.modifiers = modifiers; - this.typeParameters = typeParameters; - this.type = type; - this.name = name; - this.parameters = parameters; - this.arrayCount = arrayCount; - this.throws_ = throws_; - this.body = block; - } - - public MethodDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc, int modifiers, List annotations, List typeParameters, Type type, String name, List parameters, int arrayCount, List receiverAnnotations, List throws_, BlockStmt block) { - super(beginLine, beginColumn, endLine, endColumn, annotations, javaDoc); - this.modifiers = modifiers; - this.typeParameters = typeParameters; - this.type = type; - this.name = name; - this.parameters = parameters; - this.arrayCount = arrayCount; - this.receiverAnnotations = receiverAnnotations; - this.throws_ = throws_; - this.body = block; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public int getArrayCount() { - return arrayCount; - } - - public BlockStmt getBody() { - return body; - } - - /** - * Return the modifiers of this member declaration. - * - * @see ModifierSet - * @return modifiers - */ - public int getModifiers() { - return modifiers; - } - - public String getName() { - return name; - } - - public List getParameters() { - return parameters; - } - - public List getReceiverAnnotations() { - return receiverAnnotations; - } - - public List getThrows() { - return throws_; - } - - public Type getType() { - return type; - } - - public List getTypeParameters() { - return typeParameters; - } - - public void setArrayCount(int arrayCount) { - this.arrayCount = arrayCount; - } - - public void setBody(BlockStmt body) { - this.body = body; - } - - public void setModifiers(int modifiers) { - this.modifiers = modifiers; - } - - public void setName(String name) { - this.name = name; - } - - public void setParameters(List parameters) { - this.parameters = parameters; - } - - public void setReceiverAnnotations(List receiverAnnotations) { - this.receiverAnnotations = receiverAnnotations; - } - - public void setThrows(List throws_) { - this.throws_ = throws_; - } - - public void setType(Type type) { - this.type = type; - } - - public void setTypeParameters(List typeParameters) { - this.typeParameters = typeParameters; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/body/ModifierSet.java b/stubparser/src/org/checkerframework/stubparser/ast/body/ModifierSet.java deleted file mode 100644 index fe617c4833f..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/body/ModifierSet.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -package org.checkerframework.stubparser.ast.body; - -import java.lang.reflect.Modifier; - -/** - * Class to hold modifiers.
- * The modifier constants declared here holds equivalent values to - * {@link Modifier} constants. - */ -public final class ModifierSet { - - /* Definitions of the bits in the modifiers field. */ - - public static final int PUBLIC = Modifier.PUBLIC; - - public static final int PRIVATE = Modifier.PRIVATE; - - public static final int PROTECTED = Modifier.PROTECTED; - - public static final int STATIC = Modifier.STATIC; - - public static final int FINAL = Modifier.FINAL; - - public static final int SYNCHRONIZED = Modifier.SYNCHRONIZED; - - public static final int VOLATILE = Modifier.VOLATILE; - - public static final int TRANSIENT = Modifier.TRANSIENT; - - public static final int NATIVE = Modifier.NATIVE; - - public static final int ABSTRACT = Modifier.ABSTRACT; - - public static final int STRICTFP = Modifier.STRICT; - - /** - * Adds the given modifier. - */ - public static int addModifier(int modifiers, int mod) { - return modifiers | mod; - } - - public static boolean hasModifier(int modifiers, int modifier) { - return (modifiers & modifier) != 0; - } - - public static boolean isAbstract(int modifiers) { - return (modifiers & ABSTRACT) != 0; - } - - public static boolean isFinal(int modifiers) { - return (modifiers & FINAL) != 0; - } - - public static boolean isNative(int modifiers) { - return (modifiers & NATIVE) != 0; - } - - public static boolean isPrivate(int modifiers) { - return (modifiers & PRIVATE) != 0; - } - - public static boolean isProtected(int modifiers) { - return (modifiers & PROTECTED) != 0; - } - - /** - * A set of accessors that indicate whether the specified modifier is in the - * set. - */ - - public static boolean isPublic(int modifiers) { - return (modifiers & PUBLIC) != 0; - } - - public static boolean isStatic(int modifiers) { - return (modifiers & STATIC) != 0; - } - - public static boolean isStrictfp(int modifiers) { - return (modifiers & STRICTFP) != 0; - } - - public static boolean isSynchronized(int modifiers) { - return (modifiers & SYNCHRONIZED) != 0; - } - - public static boolean isTransient(int modifiers) { - return (modifiers & TRANSIENT) != 0; - } - - public static boolean isVolatile(int modifiers) { - return (modifiers & VOLATILE) != 0; - } - - /** - * Removes the given modifier. - */ - public static int removeModifier(int modifiers, int mod) { - return modifiers & ~mod; - } - - private ModifierSet() { - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/body/Parameter.java b/stubparser/src/org/checkerframework/stubparser/ast/body/Parameter.java deleted file mode 100644 index 5a30423d2c7..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/body/Parameter.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 03/11/2006 - */ -package org.checkerframework.stubparser.ast.body; - -import java.util.List; - -import org.checkerframework.stubparser.ast.Node; -import org.checkerframework.stubparser.ast.expr.AnnotationExpr; -import org.checkerframework.stubparser.ast.type.Type; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class Parameter extends Node { - - private int modifiers; - - private List annotations; - - private Type type; - - private boolean isVarArgs; - - private VariableDeclaratorId id; - - public Parameter() { - } - - public Parameter(Type type, VariableDeclaratorId id) { - this.type = type; - this.id = id; - } - - public Parameter(int modifiers, Type type, VariableDeclaratorId id) { - this.modifiers = modifiers; - this.type = type; - this.id = id; - } - - public Parameter(int beginLine, int beginColumn, int endLine, int endColumn, int modifiers, List annotations, Type type, boolean isVarArgs, VariableDeclaratorId id) { - super(beginLine, beginColumn, endLine, endColumn); - this.modifiers = modifiers; - this.annotations = annotations; - this.type = type; - this.isVarArgs = isVarArgs; - this.id = id; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public
void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public List getAnnotations() { - return annotations; - } - - public VariableDeclaratorId getId() { - return id; - } - - /** - * Return the modifiers of this parameter declaration. - * - * @see ModifierSet - * @return modifiers - */ - public int getModifiers() { - return modifiers; - } - - public Type getType() { - return type; - } - - public boolean isVarArgs() { - return isVarArgs; - } - - public void setAnnotations(List annotations) { - this.annotations = annotations; - } - - public void setId(VariableDeclaratorId id) { - this.id = id; - } - - public void setModifiers(int modifiers) { - this.modifiers = modifiers; - } - - public void setType(Type type) { - this.type = type; - } - - public void setVarArgs(boolean isVarArgs) { - this.isVarArgs = isVarArgs; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/body/TypeDeclaration.java b/stubparser/src/org/checkerframework/stubparser/ast/body/TypeDeclaration.java deleted file mode 100644 index 98044c0535f..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/body/TypeDeclaration.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.body; - -import java.util.List; - -import org.checkerframework.stubparser.ast.expr.AnnotationExpr; - -/** - * @author Julio Vilmar Gesser - */ -public abstract class TypeDeclaration extends BodyDeclaration { - - private String name; - - private int modifiers; - - private List members; - - public TypeDeclaration() { - } - - public TypeDeclaration(int modifiers, String name) { - this.name = name; - this.modifiers = modifiers; - } - - public TypeDeclaration(List annotations, JavadocComment javaDoc, int modifiers, String name, List members) { - super(annotations, javaDoc); - this.name = name; - this.modifiers = modifiers; - this.members = members; - } - - public TypeDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, List annotations, JavadocComment javaDoc, int modifiers, String name, List members) { - super(beginLine, beginColumn, endLine, endColumn, annotations, javaDoc); - this.name = name; - this.modifiers = modifiers; - this.members = members; - } - - public final List getMembers() { - return members; - } - - /** - * Return the modifiers of this type declaration. - * - * @see ModifierSet - * @return modifiers - */ - public final int getModifiers() { - return modifiers; - } - - public final String getName() { - return name; - } - - public void setMembers(List members) { - this.members = members; - } - - public final void setModifiers(int modifiers) { - this.modifiers = modifiers; - } - - public final void setName(String name) { - this.name = name; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/body/VariableDeclarator.java b/stubparser/src/org/checkerframework/stubparser/ast/body/VariableDeclarator.java deleted file mode 100644 index 4e2f43d80db..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/body/VariableDeclarator.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.body; - -import org.checkerframework.stubparser.ast.Node; -import org.checkerframework.stubparser.ast.expr.Expression; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class VariableDeclarator extends Node { - - private VariableDeclaratorId id; - - private Expression init; - - public VariableDeclarator() { - } - - public VariableDeclarator(VariableDeclaratorId id) { - this.id = id; - } - - public VariableDeclarator(VariableDeclaratorId id, Expression init) { - this.id = id; - this.init = init; - } - - public VariableDeclarator(int beginLine, int beginColumn, int endLine, int endColumn, VariableDeclaratorId id, Expression init) { - super(beginLine, beginColumn, endLine, endColumn); - this.id = id; - this.init = init; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public VariableDeclaratorId getId() { - return id; - } - - public Expression getInit() { - return init; - } - - public void setId(VariableDeclaratorId id) { - this.id = id; - } - - public void setInit(Expression init) { - this.init = init; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/body/VariableDeclaratorId.java b/stubparser/src/org/checkerframework/stubparser/ast/body/VariableDeclaratorId.java deleted file mode 100644 index ff744c0497c..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/body/VariableDeclaratorId.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.body; - -import org.checkerframework.stubparser.ast.Node; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class VariableDeclaratorId extends Node { - - private String name; - - private int arrayCount; - - public VariableDeclaratorId() { - } - - public VariableDeclaratorId(String name) { - this.name = name; - } - - public VariableDeclaratorId(int beginLine, int beginColumn, int endLine, int endColumn, String name, int arrayCount) { - super(beginLine, beginColumn, endLine, endColumn); - this.name = name; - this.arrayCount = arrayCount; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public int getArrayCount() { - return arrayCount; - } - - public String getName() { - return name; - } - - public void setArrayCount(int arrayCount) { - this.arrayCount = arrayCount; - } - - public void setName(String name) { - this.name = name; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/AnnotationExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/AnnotationExpr.java deleted file mode 100644 index 7852fdd684e..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/AnnotationExpr.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 21/11/2006 - */ -package org.checkerframework.stubparser.ast.expr; - -/** - * @author Julio Vilmar Gesser - */ -public abstract class AnnotationExpr extends Expression { - - protected NameExpr name; - - public AnnotationExpr() { - } - - public AnnotationExpr(int beginLine, int beginColumn, int endLine, int endColumn) { - super(beginLine, beginColumn, endLine, endColumn); - } - - public NameExpr getName() { - return name; - } - - public void setName(NameExpr name) { - this.name = name; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/ArrayAccessExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/ArrayAccessExpr.java deleted file mode 100644 index 7ae544c5cd5..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/ArrayAccessExpr.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.expr; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class ArrayAccessExpr extends Expression { - - private Expression name; - - private Expression index; - - public ArrayAccessExpr() { - } - - public ArrayAccessExpr(Expression name, Expression index) { - this.name = name; - this.index = index; - } - - public ArrayAccessExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression name, Expression index) { - super(beginLine, beginColumn, endLine, endColumn); - this.name = name; - this.index = index; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getIndex() { - return index; - } - - public Expression getName() { - return name; - } - - public void setIndex(Expression index) { - this.index = index; - } - - public void setName(Expression name) { - this.name = name; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/ArrayCreationExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/ArrayCreationExpr.java deleted file mode 100644 index b3462c45254..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/ArrayCreationExpr.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.expr; - -import java.util.List; - -import org.checkerframework.stubparser.ast.type.Type; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class ArrayCreationExpr extends Expression { - - private Type type; - - private int arrayCount; - - private ArrayInitializerExpr initializer; - - private List dimensions; - - public ArrayCreationExpr() { - } - - public ArrayCreationExpr(Type type, int arrayCount, ArrayInitializerExpr initializer) { - this.type = type; - this.arrayCount = arrayCount; - this.initializer = initializer; - this.dimensions = null; - } - - public ArrayCreationExpr(int beginLine, int beginColumn, int endLine, int endColumn, Type type, int arrayCount, ArrayInitializerExpr initializer) { - super(beginLine, beginColumn, endLine, endColumn); - this.type = type; - this.arrayCount = arrayCount; - this.initializer = initializer; - this.dimensions = null; - } - - public ArrayCreationExpr(Type type, List dimensions, int arrayCount) { - this.type = type; - this.arrayCount = arrayCount; - this.dimensions = dimensions; - this.initializer = null; - } - - public ArrayCreationExpr(int beginLine, int beginColumn, int endLine, int endColumn, Type type, List dimensions, int arrayCount) { - super(beginLine, beginColumn, endLine, endColumn); - this.type = type; - this.arrayCount = arrayCount; - this.dimensions = dimensions; - this.initializer = null; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public int getArrayCount() { - return arrayCount; - } - - public List getDimensions() { - return dimensions; - } - - public ArrayInitializerExpr getInitializer() { - return initializer; - } - - public Type getType() { - return type; - } - - public void setArrayCount(int arrayCount) { - this.arrayCount = arrayCount; - } - - public void setDimensions(List dimensions) { - this.dimensions = dimensions; - } - - public void setInitializer(ArrayInitializerExpr initializer) { - this.initializer = initializer; - } - - public void setType(Type type) { - this.type = type; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/ArrayInitializerExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/ArrayInitializerExpr.java deleted file mode 100644 index 7cb887e537c..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/ArrayInitializerExpr.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.expr; - -import java.util.List; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class ArrayInitializerExpr extends Expression { - - private List values; - - public ArrayInitializerExpr() { - } - - public ArrayInitializerExpr(List values) { - this.values = values; - } - - public ArrayInitializerExpr(int beginLine, int beginColumn, int endLine, int endColumn, List values) { - super(beginLine, beginColumn, endLine, endColumn); - this.values = values; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public List getValues() { - return values; - } - - public void setValues(List values) { - this.values = values; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/AssignExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/AssignExpr.java deleted file mode 100644 index 1bc250ecd72..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/AssignExpr.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.expr; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class AssignExpr extends Expression { - - public static enum Operator { - assign, // = - plus, // += - minus, // -= - star, // *= - slash, // /= - and, // &= - or, // |= - xor, // ^= - rem, // %= - lShift, // <<= - rSignedShift, // >>= - rUnsignedShift, // >>>= - } - - private Expression target; - - private Expression value; - - private Operator op; - - public AssignExpr() { - } - - public AssignExpr(Expression target, Expression value, Operator op) { - this.target = target; - this.value = value; - this.op = op; - } - - public AssignExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression target, Expression value, Operator op) { - super(beginLine, beginColumn, endLine, endColumn); - this.target = target; - this.value = value; - this.op = op; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Operator getOperator() { - return op; - } - - public Expression getTarget() { - return target; - } - - public Expression getValue() { - return value; - } - - public void setOperator(Operator op) { - this.op = op; - } - - public void setTarget(Expression target) { - this.target = target; - } - - public void setValue(Expression value) { - this.value = value; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/BinaryExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/BinaryExpr.java deleted file mode 100644 index 5560e2f1827..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/BinaryExpr.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.expr; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class BinaryExpr extends Expression { - - public static enum Operator { - or, // || - and, // && - binOr, // | - binAnd, // & - xor, // ^ - equals, // == - notEquals, // != - less, // < - greater, // > - lessEquals, // <= - greaterEquals, // >= - lShift, // << - rSignedShift, // >> - rUnsignedShift, // >>> - plus, // + - minus, // - - times, // * - divide, // / - remainder, // % - } - - private Expression left; - - private Expression right; - - private Operator op; - - public BinaryExpr() { - } - - public BinaryExpr(Expression left, Expression right, Operator op) { - this.left = left; - this.right = right; - this.op = op; - } - - public BinaryExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression left, Expression right, Operator op) { - super(beginLine, beginColumn, endLine, endColumn); - this.left = left; - this.right = right; - this.op = op; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getLeft() { - return left; - } - - public Operator getOperator() { - return op; - } - - public Expression getRight() { - return right; - } - - public void setLeft(Expression left) { - this.left = left; - } - - public void setOperator(Operator op) { - this.op = op; - } - - public void setRight(Expression right) { - this.right = right; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/BooleanLiteralExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/BooleanLiteralExpr.java deleted file mode 100644 index 9c032fe7139..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/BooleanLiteralExpr.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 02/03/2007 - */ -package org.checkerframework.stubparser.ast.expr; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class BooleanLiteralExpr extends LiteralExpr { - - private boolean value; - - public BooleanLiteralExpr() { - } - - public BooleanLiteralExpr(boolean value) { - this.value = value; - } - - public BooleanLiteralExpr(int beginLine, int beginColumn, int endLine, int endColumn, boolean value) { - super(beginLine, beginColumn, endLine, endColumn); - this.value = value; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public boolean getValue() { - return value; - } - - public void setValue(boolean value) { - this.value = value; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/CastExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/CastExpr.java deleted file mode 100644 index 998251e5e9e..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/CastExpr.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.expr; - -import org.checkerframework.stubparser.ast.type.Type; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class CastExpr extends Expression { - - private Type type; - - private Expression expr; - - public CastExpr() { - } - - public CastExpr(Type type, Expression expr) { - this.type = type; - this.expr = expr; - } - - public CastExpr(int beginLine, int beginColumn, int endLine, int endColumn, Type type, Expression expr) { - super(beginLine, beginColumn, endLine, endColumn); - this.type = type; - this.expr = expr; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getExpr() { - return expr; - } - - public Type getType() { - return type; - } - - public void setExpr(Expression expr) { - this.expr = expr; - } - - public void setType(Type type) { - this.type = type; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/CharLiteralExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/CharLiteralExpr.java deleted file mode 100644 index cb832b1f03c..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/CharLiteralExpr.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 02/03/2007 - */ -package org.checkerframework.stubparser.ast.expr; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class CharLiteralExpr extends StringLiteralExpr { - - public CharLiteralExpr() { - } - - public CharLiteralExpr(String value) { - super(value); - } - - public CharLiteralExpr(int beginLine, int beginColumn, int endLine, int endColumn, String value) { - super(beginLine, beginColumn, endLine, endColumn, value); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/ClassExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/ClassExpr.java deleted file mode 100644 index a51a13d945f..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/ClassExpr.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.expr; - -import org.checkerframework.stubparser.ast.type.Type; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class ClassExpr extends Expression { - - private Type type; - - public ClassExpr() { - } - - public ClassExpr(Type type) { - this.type = type; - } - - public ClassExpr(int beginLine, int beginColumn, int endLine, int endColumn, Type type) { - super(beginLine, beginColumn, endLine, endColumn); - this.type = type; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Type getType() { - return type; - } - - public void setType(Type type) { - this.type = type; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/ConditionalExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/ConditionalExpr.java deleted file mode 100644 index f5a5570bf75..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/ConditionalExpr.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.expr; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class ConditionalExpr extends Expression { - - private Expression condition; - - private Expression thenExpr; - - private Expression elseExpr; - - public ConditionalExpr() { - } - - public ConditionalExpr(Expression condition, Expression thenExpr, Expression elseExpr) { - this.condition = condition; - this.thenExpr = thenExpr; - this.elseExpr = elseExpr; - } - - public ConditionalExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression condition, Expression thenExpr, Expression elseExpr) { - super(beginLine, beginColumn, endLine, endColumn); - this.condition = condition; - this.thenExpr = thenExpr; - this.elseExpr = elseExpr; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getCondition() { - return condition; - } - - public Expression getElseExpr() { - return elseExpr; - } - - public Expression getThenExpr() { - return thenExpr; - } - - public void setCondition(Expression condition) { - this.condition = condition; - } - - public void setElseExpr(Expression elseExpr) { - this.elseExpr = elseExpr; - } - - public void setThenExpr(Expression thenExpr) { - this.thenExpr = thenExpr; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/DoubleLiteralExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/DoubleLiteralExpr.java deleted file mode 100644 index 44076ac26be..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/DoubleLiteralExpr.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 02/03/2007 - */ -package org.checkerframework.stubparser.ast.expr; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class DoubleLiteralExpr extends StringLiteralExpr { - - public DoubleLiteralExpr() { - } - - public DoubleLiteralExpr(String value) { - super(value); - } - - public DoubleLiteralExpr(int beginLine, int beginColumn, int endLine, int endColumn, String value) { - super(beginLine, beginColumn, endLine, endColumn, value); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/EnclosedExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/EnclosedExpr.java deleted file mode 100644 index db7dd873de8..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/EnclosedExpr.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.expr; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class EnclosedExpr extends Expression { - - private Expression inner; - - public EnclosedExpr() { - } - - public EnclosedExpr(Expression inner) { - this.inner = inner; - } - - public EnclosedExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression inner) { - super(beginLine, beginColumn, endLine, endColumn); - this.inner = inner; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getInner() { - return inner; - } - - public void setInner(Expression inner) { - this.inner = inner; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/Expression.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/Expression.java deleted file mode 100644 index 618d9c8512c..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/Expression.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 10/10/2006 - */ -package org.checkerframework.stubparser.ast.expr; - -import org.checkerframework.stubparser.ast.Node; - -/** - * @author Julio Vilmar Gesser - */ -public abstract class Expression extends Node { - - public Expression() { - } - - public Expression(int beginLine, int beginColumn, int endLine, int endColumn) { - super(beginLine, beginColumn, endLine, endColumn); - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/FieldAccessExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/FieldAccessExpr.java deleted file mode 100644 index 216e2eff839..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/FieldAccessExpr.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.expr; - -import java.util.List; - -import org.checkerframework.stubparser.ast.type.Type; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class FieldAccessExpr extends Expression { - - private Expression scope; - - private List typeArgs; - - private String field; - - public FieldAccessExpr() { - } - - public FieldAccessExpr(Expression scope, String field) { - this.scope = scope; - this.field = field; - } - - public FieldAccessExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression scope, List typeArgs, String field) { - super(beginLine, beginColumn, endLine, endColumn); - this.scope = scope; - this.typeArgs = typeArgs; - this.field = field; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public String getField() { - return field; - } - - public Expression getScope() { - return scope; - } - - public List getTypeArgs() { - return typeArgs; - } - - public void setField(String field) { - this.field = field; - } - - public void setScope(Expression scope) { - this.scope = scope; - } - - public void setTypeArgs(List typeArgs) { - this.typeArgs = typeArgs; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/InstanceOfExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/InstanceOfExpr.java deleted file mode 100644 index 9f6cf09e109..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/InstanceOfExpr.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.expr; - -import org.checkerframework.stubparser.ast.type.Type; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class InstanceOfExpr extends Expression { - - private Expression expr; - - private Type type; - - public InstanceOfExpr() { - } - - public InstanceOfExpr(Expression expr, Type type) { - this.expr = expr; - this.type = type; - } - - public InstanceOfExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression expr, Type type) { - super(beginLine, beginColumn, endLine, endColumn); - this.expr = expr; - this.type = type; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getExpr() { - return expr; - } - - public Type getType() { - return type; - } - - public void setExpr(Expression expr) { - this.expr = expr; - } - - public void setType(Type type) { - this.type = type; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/IntegerLiteralExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/IntegerLiteralExpr.java deleted file mode 100644 index 275d5ec78b0..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/IntegerLiteralExpr.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 02/03/2007 - */ -package org.checkerframework.stubparser.ast.expr; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public class IntegerLiteralExpr extends StringLiteralExpr { - - private static final String UNSIGNED_MIN_VALUE = "2147483648"; - - protected static final String MIN_VALUE = "-" + UNSIGNED_MIN_VALUE; - - public IntegerLiteralExpr() { - } - - public IntegerLiteralExpr(String value) { - super(value); - } - - public IntegerLiteralExpr(int beginLine, int beginColumn, int endLine, int endColumn, String value) { - super(beginLine, beginColumn, endLine, endColumn, value); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public final boolean isMinValue() { - return value != null && // - value.length() == 10 && // - value.equals(UNSIGNED_MIN_VALUE); - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/IntegerLiteralMinValueExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/IntegerLiteralMinValueExpr.java deleted file mode 100644 index d56a78bed6d..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/IntegerLiteralMinValueExpr.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 09/03/2007 - */ -package org.checkerframework.stubparser.ast.expr; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class IntegerLiteralMinValueExpr extends IntegerLiteralExpr { - - public IntegerLiteralMinValueExpr() { - super(MIN_VALUE); - } - - public IntegerLiteralMinValueExpr(int beginLine, int beginColumn, int endLine, int endColumn) { - super(beginLine, beginColumn, endLine, endColumn, MIN_VALUE); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/LiteralExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/LiteralExpr.java deleted file mode 100644 index 781b5caa79c..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/LiteralExpr.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.expr; - -/** - * @author Julio Vilmar Gesser - */ -public abstract class LiteralExpr extends Expression { - - public LiteralExpr() { - } - - public LiteralExpr(int beginLine, int beginColumn, int endLine, int endColumn) { - super(beginLine, beginColumn, endLine, endColumn); - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/LongLiteralExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/LongLiteralExpr.java deleted file mode 100644 index a4b5e2eec06..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/LongLiteralExpr.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 02/03/2007 - */ -package org.checkerframework.stubparser.ast.expr; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public class LongLiteralExpr extends StringLiteralExpr { - - private static final String UNSIGNED_MIN_VALUE = "9223372036854775808"; - - protected static final String MIN_VALUE = "-" + UNSIGNED_MIN_VALUE + "L"; - - public LongLiteralExpr() { - } - - public LongLiteralExpr(String value) { - super(value); - } - - public LongLiteralExpr(int beginLine, int beginColumn, int endLine, int endColumn, String value) { - super(beginLine, beginColumn, endLine, endColumn, value); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public final boolean isMinValue() { - return value != null && // - value.length() == 20 && // - value.startsWith(UNSIGNED_MIN_VALUE) && // - (value.charAt(19) == 'L' || value.charAt(19) == 'l'); - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/LongLiteralMinValueExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/LongLiteralMinValueExpr.java deleted file mode 100644 index d533d43bd41..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/LongLiteralMinValueExpr.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 09/03/2007 - */ -package org.checkerframework.stubparser.ast.expr; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class LongLiteralMinValueExpr extends LongLiteralExpr { - - public LongLiteralMinValueExpr() { - super(MIN_VALUE); - } - - public LongLiteralMinValueExpr(int beginLine, int beginColumn, int endLine, int endColumn) { - super(beginLine, beginColumn, endLine, endColumn, MIN_VALUE); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/MarkerAnnotationExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/MarkerAnnotationExpr.java deleted file mode 100644 index d62ecdc9a9e..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/MarkerAnnotationExpr.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 21/11/2006 - */ -package org.checkerframework.stubparser.ast.expr; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class MarkerAnnotationExpr extends AnnotationExpr { - - public MarkerAnnotationExpr() { - } - - public MarkerAnnotationExpr(NameExpr name) { - this.name = name; - } - - public MarkerAnnotationExpr(int beginLine, int beginColumn, int endLine, int endColumn, NameExpr name) { - super(beginLine, beginColumn, endLine, endColumn); - this.name = name; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/MemberValuePair.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/MemberValuePair.java deleted file mode 100644 index 06a9870e786..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/MemberValuePair.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 21/11/2006 - */ -package org.checkerframework.stubparser.ast.expr; - -import org.checkerframework.stubparser.ast.Node; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class MemberValuePair extends Node { - - private String name; - - private Expression value; - - public MemberValuePair() { - } - - public MemberValuePair(String name, Expression value) { - this.name = name; - this.value = value; - } - - public MemberValuePair(int beginLine, int beginColumn, int endLine, int endColumn, String name, Expression value) { - super(beginLine, beginColumn, endLine, endColumn); - this.name = name; - this.value = value; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public String getName() { - return name; - } - - public Expression getValue() { - return value; - } - - public void setName(String name) { - this.name = name; - } - - public void setValue(Expression value) { - this.value = value; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/MethodCallExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/MethodCallExpr.java deleted file mode 100644 index b3eda5e4cd6..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/MethodCallExpr.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.expr; - -import java.util.List; - -import org.checkerframework.stubparser.ast.type.Type; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class MethodCallExpr extends Expression { - - private Expression scope; - - private List typeArgs; - - private String name; - - private List args; - - public MethodCallExpr() { - } - - public MethodCallExpr(Expression scope, String name) { - this.scope = scope; - this.name = name; - } - - public MethodCallExpr(Expression scope, String name, List args) { - this.scope = scope; - this.name = name; - this.args = args; - } - - public MethodCallExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression scope, List typeArgs, String name, List args) { - super(beginLine, beginColumn, endLine, endColumn); - this.scope = scope; - this.typeArgs = typeArgs; - this.name = name; - this.args = args; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public List getArgs() { - return args; - } - - public String getName() { - return name; - } - - public Expression getScope() { - return scope; - } - - public List getTypeArgs() { - return typeArgs; - } - - public void setArgs(List args) { - this.args = args; - } - - public void setName(String name) { - this.name = name; - } - - public void setScope(Expression scope) { - this.scope = scope; - } - - public void setTypeArgs(List typeArgs) { - this.typeArgs = typeArgs; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/NameExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/NameExpr.java deleted file mode 100644 index cf4ae33e2b5..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/NameExpr.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.expr; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public class NameExpr extends Expression { - - private String name; - - public NameExpr() { - } - - public NameExpr(String name) { - this.name = name; - } - - public NameExpr(int beginLine, int beginColumn, int endLine, int endColumn, String name) { - super(beginLine, beginColumn, endLine, endColumn); - this.name = name; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public final String getName() { - return name; - } - - public final void setName(String name) { - this.name = name; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/NormalAnnotationExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/NormalAnnotationExpr.java deleted file mode 100644 index c8f6e8069a6..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/NormalAnnotationExpr.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 21/11/2006 - */ -package org.checkerframework.stubparser.ast.expr; - -import java.util.List; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class NormalAnnotationExpr extends AnnotationExpr { - - private List pairs; - - public NormalAnnotationExpr() { - } - - public NormalAnnotationExpr(NameExpr name, List pairs) { - this.name = name; - this.pairs = pairs; - } - - public NormalAnnotationExpr(int beginLine, int beginColumn, int endLine, int endColumn, NameExpr name, List pairs) { - super(beginLine, beginColumn, endLine, endColumn); - this.name = name; - this.pairs = pairs; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public List getPairs() { - return pairs; - } - - public void setPairs(List pairs) { - this.pairs = pairs; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/NullLiteralExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/NullLiteralExpr.java deleted file mode 100644 index 8301e6d7b16..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/NullLiteralExpr.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 02/03/2007 - */ -package org.checkerframework.stubparser.ast.expr; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class NullLiteralExpr extends LiteralExpr { - - public NullLiteralExpr() { - } - - public NullLiteralExpr(int beginLine, int beginColumn, int endLine, int endColumn) { - super(beginLine, beginColumn, endLine, endColumn); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/ObjectCreationExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/ObjectCreationExpr.java deleted file mode 100644 index c08cadfa3be..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/ObjectCreationExpr.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.expr; - -import java.util.List; - -import org.checkerframework.stubparser.ast.body.BodyDeclaration; -import org.checkerframework.stubparser.ast.type.ClassOrInterfaceType; -import org.checkerframework.stubparser.ast.type.Type; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class ObjectCreationExpr extends Expression { - - private Expression scope; - - private ClassOrInterfaceType type; - - private List typeArgs; - - private List args; - - private List anonymousClassBody; - - public ObjectCreationExpr() { - } - - public ObjectCreationExpr(Expression scope, ClassOrInterfaceType type, List args) { - this.scope = scope; - this.type = type; - this.args = args; - } - - public ObjectCreationExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression scope, ClassOrInterfaceType type, List typeArgs, List args, List anonymousBody) { - super(beginLine, beginColumn, endLine, endColumn); - this.scope = scope; - this.type = type; - this.typeArgs = typeArgs; - this.args = args; - this.anonymousClassBody = anonymousBody; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public List getAnonymousClassBody() { - return anonymousClassBody; - } - - public List getArgs() { - return args; - } - - public Expression getScope() { - return scope; - } - - public ClassOrInterfaceType getType() { - return type; - } - - public List getTypeArgs() { - return typeArgs; - } - - public void setAnonymousClassBody(List anonymousClassBody) { - this.anonymousClassBody = anonymousClassBody; - } - - public void setArgs(List args) { - this.args = args; - } - - public void setScope(Expression scope) { - this.scope = scope; - } - - public void setType(ClassOrInterfaceType type) { - this.type = type; - } - - public void setTypeArgs(List typeArgs) { - this.typeArgs = typeArgs; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/QualifiedNameExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/QualifiedNameExpr.java deleted file mode 100644 index 0d35e1d9ac1..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/QualifiedNameExpr.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.expr; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class QualifiedNameExpr extends NameExpr { - - private NameExpr qualifier; - - public QualifiedNameExpr() { - } - - public QualifiedNameExpr(NameExpr scope, String name) { - super(name); - this.qualifier = scope; - } - - public QualifiedNameExpr(int beginLine, int beginColumn, int endLine, int endColumn, NameExpr scope, String name) { - super(beginLine, beginColumn, endLine, endColumn, name); - this.qualifier = scope; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public NameExpr getQualifier() { - return qualifier; - } - - public void setQualifier(NameExpr qualifier) { - this.qualifier = qualifier; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/SingleMemberAnnotationExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/SingleMemberAnnotationExpr.java deleted file mode 100644 index a22228a5890..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/SingleMemberAnnotationExpr.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 21/11/2006 - */ -package org.checkerframework.stubparser.ast.expr; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class SingleMemberAnnotationExpr extends AnnotationExpr { - - private Expression memberValue; - - public SingleMemberAnnotationExpr() { - } - - public SingleMemberAnnotationExpr(NameExpr name, Expression memberValue) { - this.name = name; - this.memberValue = memberValue; - } - - public SingleMemberAnnotationExpr(int beginLine, int beginColumn, int endLine, int endColumn, NameExpr name, Expression memberValue) { - super(beginLine, beginColumn, endLine, endColumn); - this.name = name; - this.memberValue = memberValue; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getMemberValue() { - return memberValue; - } - - public void setMemberValue(Expression memberValue) { - this.memberValue = memberValue; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/StringLiteralExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/StringLiteralExpr.java deleted file mode 100644 index 3bea6ac0cf8..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/StringLiteralExpr.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 02/03/2007 - */ -package org.checkerframework.stubparser.ast.expr; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public class StringLiteralExpr extends LiteralExpr { - - protected String value; - - public StringLiteralExpr() { - } - - public StringLiteralExpr(String value) { - this.value = value; - } - - public StringLiteralExpr(int beginLine, int beginColumn, int endLine, int endColumn, String value) { - super(beginLine, beginColumn, endLine, endColumn); - this.value = value; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public final String getValue() { - return value; - } - - public final void setValue(String value) { - this.value = value; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/SuperExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/SuperExpr.java deleted file mode 100644 index 08769eaed0c..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/SuperExpr.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 20/01/2007 - */ -package org.checkerframework.stubparser.ast.expr; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class SuperExpr extends Expression { - - private Expression classExpr; - - public SuperExpr() { - } - - public SuperExpr(Expression classExpr) { - this.classExpr = classExpr; - } - - public SuperExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression classExpr) { - super(beginLine, beginColumn, endLine, endColumn); - this.classExpr = classExpr; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getClassExpr() { - return classExpr; - } - - public void setClassExpr(Expression classExpr) { - this.classExpr = classExpr; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/ThisExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/ThisExpr.java deleted file mode 100644 index 92559c30203..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/ThisExpr.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.expr; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class ThisExpr extends Expression { - - private Expression classExpr; - - public ThisExpr() { - } - - public ThisExpr(Expression classExpr) { - this.classExpr = classExpr; - } - - public ThisExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression classExpr) { - super(beginLine, beginColumn, endLine, endColumn); - this.classExpr = classExpr; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getClassExpr() { - return classExpr; - } - - public void setClassExpr(Expression classExpr) { - this.classExpr = classExpr; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/UnaryExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/UnaryExpr.java deleted file mode 100644 index 4c99b691981..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/UnaryExpr.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.expr; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class UnaryExpr extends Expression { - - public static enum Operator { - positive, // + - negative, // - - preIncrement, // ++ - preDecrement, // -- - not, // ! - inverse, // ~ - posIncrement, // ++ - posDecrement, // -- - } - - private Expression expr; - - private Operator op; - - public UnaryExpr() { - } - - public UnaryExpr(Expression expr, Operator op) { - this.expr = expr; - this.op = op; - } - - public UnaryExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression expr, Operator op) { - super(beginLine, beginColumn, endLine, endColumn); - this.expr = expr; - this.op = op; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getExpr() { - return expr; - } - - public Operator getOperator() { - return op; - } - - public void setExpr(Expression expr) { - this.expr = expr; - } - - public void setOperator(Operator op) { - this.op = op; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/expr/VariableDeclarationExpr.java b/stubparser/src/org/checkerframework/stubparser/ast/expr/VariableDeclarationExpr.java deleted file mode 100644 index d850696a874..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/expr/VariableDeclarationExpr.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 03/11/2006 - */ -package org.checkerframework.stubparser.ast.expr; - -import java.util.List; - -import org.checkerframework.stubparser.ast.body.ModifierSet; -import org.checkerframework.stubparser.ast.body.VariableDeclarator; -import org.checkerframework.stubparser.ast.type.Type; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class VariableDeclarationExpr extends Expression { - - private int modifiers; - - private List annotations; - - private Type type; - - private List vars; - - public VariableDeclarationExpr() { - } - - public VariableDeclarationExpr(Type type, List vars) { - this.type = type; - this.vars = vars; - } - - public VariableDeclarationExpr(int modifiers, Type type, List vars) { - this.modifiers = modifiers; - this.type = type; - this.vars = vars; - } - - public VariableDeclarationExpr(int beginLine, int beginColumn, int endLine, int endColumn, int modifiers, List annotations, Type type, List vars) { - super(beginLine, beginColumn, endLine, endColumn); - this.modifiers = modifiers; - this.annotations = annotations; - this.type = type; - this.vars = vars; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public List getAnnotations() { - return annotations; - } - - /** - * Return the modifiers of this variable declaration. - * - * @see ModifierSet - * @return modifiers - */ - public int getModifiers() { - return modifiers; - } - - public Type getType() { - return type; - } - - public List getVars() { - return vars; - } - - public void setAnnotations(List annotations) { - this.annotations = annotations; - } - - public void setModifiers(int modifiers) { - this.modifiers = modifiers; - } - - public void setType(Type type) { - this.type = type; - } - - public void setVars(List vars) { - this.vars = vars; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/stmt/AssertStmt.java b/stubparser/src/org/checkerframework/stubparser/ast/stmt/AssertStmt.java deleted file mode 100644 index 6af20a58369..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/stmt/AssertStmt.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 04/11/2006 - */ -package org.checkerframework.stubparser.ast.stmt; - -import org.checkerframework.stubparser.ast.expr.Expression; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class AssertStmt extends Statement { - - private Expression check; - - private Expression msg; - - public AssertStmt() { - } - - public AssertStmt(Expression check) { - this.check = check; - } - - public AssertStmt(Expression check, Expression msg) { - this.check = check; - this.msg = msg; - } - - public AssertStmt(int beginLine, int beginColumn, int endLine, int endColumn, Expression check, Expression msg) { - super(beginLine, beginColumn, endLine, endColumn); - this.check = check; - this.msg = msg; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getCheck() { - return check; - } - - public Expression getMessage() { - return msg; - } - - public void setCheck(Expression check) { - this.check = check; - } - - public void setMessage(Expression msg) { - this.msg = msg; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/stmt/BlockStmt.java b/stubparser/src/org/checkerframework/stubparser/ast/stmt/BlockStmt.java deleted file mode 100644 index 2282df49e16..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/stmt/BlockStmt.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 04/11/2006 - */ -package org.checkerframework.stubparser.ast.stmt; - -import java.util.List; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class BlockStmt extends Statement { - - private List stmts; - - public BlockStmt() { - } - - public BlockStmt(List stmts) { - this.stmts = stmts; - } - - public BlockStmt(int beginLine, int beginColumn, int endLine, int endColumn, List stmts) { - super(beginLine, beginColumn, endLine, endColumn); - this.stmts = stmts; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public List getStmts() { - return stmts; - } - - public void setStmts(List stmts) { - this.stmts = stmts; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/stmt/BreakStmt.java b/stubparser/src/org/checkerframework/stubparser/ast/stmt/BreakStmt.java deleted file mode 100644 index ee87960a49e..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/stmt/BreakStmt.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 04/11/2006 - */ -package org.checkerframework.stubparser.ast.stmt; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class BreakStmt extends Statement { - - private String id; - - public BreakStmt() { - } - - public BreakStmt(String id) { - this.id = id; - } - - public BreakStmt(int beginLine, int beginColumn, int endLine, int endColumn, String id) { - super(beginLine, beginColumn, endLine, endColumn); - this.id = id; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/stmt/CatchClause.java b/stubparser/src/org/checkerframework/stubparser/ast/stmt/CatchClause.java deleted file mode 100644 index e4983dc02ca..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/stmt/CatchClause.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 18/11/2006 - */ -package org.checkerframework.stubparser.ast.stmt; - -import org.checkerframework.stubparser.ast.Node; -import org.checkerframework.stubparser.ast.body.Parameter; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class CatchClause extends Node { - - private Parameter except; - - private BlockStmt catchBlock; - - public CatchClause() { - } - - public CatchClause(Parameter except, BlockStmt catchBlock) { - this.except = except; - this.catchBlock = catchBlock; - } - - public CatchClause(int beginLine, int beginColumn, int endLine, int endColumn, Parameter except, BlockStmt catchBlock) { - super(beginLine, beginColumn, endLine, endColumn); - this.except = except; - this.catchBlock = catchBlock; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public BlockStmt getCatchBlock() { - return catchBlock; - } - - public Parameter getExcept() { - return except; - } - - public void setCatchBlock(BlockStmt catchBlock) { - this.catchBlock = catchBlock; - } - - public void setExcept(Parameter except) { - this.except = except; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/stmt/ContinueStmt.java b/stubparser/src/org/checkerframework/stubparser/ast/stmt/ContinueStmt.java deleted file mode 100644 index 49cf56f28b9..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/stmt/ContinueStmt.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 07/11/2006 - */ -package org.checkerframework.stubparser.ast.stmt; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class ContinueStmt extends Statement { - - private String id; - - public ContinueStmt() { - } - - public ContinueStmt(String id) { - this.id = id; - } - - public ContinueStmt(int beginLine, int beginColumn, int endLine, int endColumn, String id) { - super(beginLine, beginColumn, endLine, endColumn); - this.id = id; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/stmt/DoStmt.java b/stubparser/src/org/checkerframework/stubparser/ast/stmt/DoStmt.java deleted file mode 100644 index bc7340e0857..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/stmt/DoStmt.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 07/11/2006 - */ -package org.checkerframework.stubparser.ast.stmt; - -import org.checkerframework.stubparser.ast.expr.Expression; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class DoStmt extends Statement { - - private Statement body; - - private Expression condition; - - public DoStmt() { - } - - public DoStmt(Statement body, Expression condition) { - this.body = body; - this.condition = condition; - } - - public DoStmt(int beginLine, int beginColumn, int endLine, int endColumn, Statement body, Expression condition) { - super(beginLine, beginColumn, endLine, endColumn); - this.body = body; - this.condition = condition; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Statement getBody() { - return body; - } - - public Expression getCondition() { - return condition; - } - - public void setBody(Statement body) { - this.body = body; - } - - public void setCondition(Expression condition) { - this.condition = condition; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/stmt/EmptyStmt.java b/stubparser/src/org/checkerframework/stubparser/ast/stmt/EmptyStmt.java deleted file mode 100644 index 661c20c2682..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/stmt/EmptyStmt.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 04/11/2006 - */ -package org.checkerframework.stubparser.ast.stmt; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class EmptyStmt extends Statement { - - public EmptyStmt() { - } - - public EmptyStmt(int beginLine, int beginColumn, int endLine, int endColumn) { - super(beginLine, beginColumn, endLine, endColumn); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/stmt/ExplicitConstructorInvocationStmt.java b/stubparser/src/org/checkerframework/stubparser/ast/stmt/ExplicitConstructorInvocationStmt.java deleted file mode 100644 index 1245303f48e..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/stmt/ExplicitConstructorInvocationStmt.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 03/11/2006 - */ -package org.checkerframework.stubparser.ast.stmt; - -import java.util.List; - -import org.checkerframework.stubparser.ast.expr.Expression; -import org.checkerframework.stubparser.ast.type.Type; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class ExplicitConstructorInvocationStmt extends Statement { - - private List typeArgs; - - private boolean isThis; - - private Expression expr; - - private List args; - - public ExplicitConstructorInvocationStmt() { - } - - public ExplicitConstructorInvocationStmt(boolean isThis, Expression expr, List args) { - this.isThis = isThis; - this.expr = expr; - this.args = args; - } - - public ExplicitConstructorInvocationStmt(int beginLine, int beginColumn, int endLine, int endColumn, List typeArgs, boolean isThis, Expression expr, List args) { - super(beginLine, beginColumn, endLine, endColumn); - this.typeArgs = typeArgs; - this.isThis = isThis; - this.expr = expr; - this.args = args; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public List getArgs() { - return args; - } - - public Expression getExpr() { - return expr; - } - - public List getTypeArgs() { - return typeArgs; - } - - public boolean isThis() { - return isThis; - } - - public void setArgs(List args) { - this.args = args; - } - - public void setExpr(Expression expr) { - this.expr = expr; - } - - public void setThis(boolean isThis) { - this.isThis = isThis; - } - - public void setTypeArgs(List typeArgs) { - this.typeArgs = typeArgs; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/stmt/ExpressionStmt.java b/stubparser/src/org/checkerframework/stubparser/ast/stmt/ExpressionStmt.java deleted file mode 100644 index ef791baf25f..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/stmt/ExpressionStmt.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 04/11/2006 - */ -package org.checkerframework.stubparser.ast.stmt; - -import org.checkerframework.stubparser.ast.expr.Expression; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class ExpressionStmt extends Statement { - - private Expression expr; - - public ExpressionStmt() { - } - - public ExpressionStmt(Expression expr) { - this.expr = expr; - } - - public ExpressionStmt(int beginLine, int beginColumn, int endLine, int endColumn, Expression expr) { - super(beginLine, beginColumn, endLine, endColumn); - this.expr = expr; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getExpression() { - return expr; - } - - public void setExpression(Expression expr) { - this.expr = expr; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/stmt/ForStmt.java b/stubparser/src/org/checkerframework/stubparser/ast/stmt/ForStmt.java deleted file mode 100644 index aa399953044..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/stmt/ForStmt.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 07/11/2006 - */ -package org.checkerframework.stubparser.ast.stmt; - -import java.util.List; - -import org.checkerframework.stubparser.ast.expr.Expression; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class ForStmt extends Statement { - - private List init; - - private Expression compare; - - private List update; - - private Statement body; - - public ForStmt() { - } - - public ForStmt(List init, Expression compare, List update, Statement body) { - this.compare = compare; - this.init = init; - this.update = update; - this.body = body; - } - - public ForStmt(int beginLine, int beginColumn, int endLine, int endColumn, List init, Expression compare, List update, Statement body) { - super(beginLine, beginColumn, endLine, endColumn); - this.compare = compare; - this.init = init; - this.update = update; - this.body = body; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Statement getBody() { - return body; - } - - public Expression getCompare() { - return compare; - } - - public List getInit() { - return init; - } - - public List getUpdate() { - return update; - } - - public void setBody(Statement body) { - this.body = body; - } - - public void setCompare(Expression compare) { - this.compare = compare; - } - - public void setInit(List init) { - this.init = init; - } - - public void setUpdate(List update) { - this.update = update; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/stmt/ForeachStmt.java b/stubparser/src/org/checkerframework/stubparser/ast/stmt/ForeachStmt.java deleted file mode 100644 index 3134eb69461..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/stmt/ForeachStmt.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 07/11/2006 - */ -package org.checkerframework.stubparser.ast.stmt; - -import org.checkerframework.stubparser.ast.expr.Expression; -import org.checkerframework.stubparser.ast.expr.VariableDeclarationExpr; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class ForeachStmt extends Statement { - - private VariableDeclarationExpr var; - - private Expression iterable; - - private Statement body; - - public ForeachStmt() { - } - - public ForeachStmt(VariableDeclarationExpr var, Expression iterable, Statement body) { - this.var = var; - this.iterable = iterable; - this.body = body; - } - - public ForeachStmt(int beginLine, int beginColumn, int endLine, int endColumn, VariableDeclarationExpr var, Expression iterable, Statement body) { - super(beginLine, beginColumn, endLine, endColumn); - this.var = var; - this.iterable = iterable; - this.body = body; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Statement getBody() { - return body; - } - - public Expression getIterable() { - return iterable; - } - - public VariableDeclarationExpr getVariable() { - return var; - } - - public void setBody(Statement body) { - this.body = body; - } - - public void setIterable(Expression iterable) { - this.iterable = iterable; - } - - public void setVariable(VariableDeclarationExpr var) { - this.var = var; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/stmt/IfStmt.java b/stubparser/src/org/checkerframework/stubparser/ast/stmt/IfStmt.java deleted file mode 100644 index 820ef5f1c8a..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/stmt/IfStmt.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 07/11/2006 - */ -package org.checkerframework.stubparser.ast.stmt; - -import org.checkerframework.stubparser.ast.expr.Expression; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class IfStmt extends Statement { - - private Expression condition; - - private Statement thenStmt; - - private Statement elseStmt; - - public IfStmt() { - } - - public IfStmt(Expression condition, Statement thenStmt, Statement elseStmt) { - this.condition = condition; - this.thenStmt = thenStmt; - this.elseStmt = elseStmt; - } - - public IfStmt(int beginLine, int beginColumn, int endLine, int endColumn, Expression condition, Statement thenStmt, Statement elseStmt) { - super(beginLine, beginColumn, endLine, endColumn); - this.condition = condition; - this.thenStmt = thenStmt; - this.elseStmt = elseStmt; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getCondition() { - return condition; - } - - public Statement getElseStmt() { - return elseStmt; - } - - public Statement getThenStmt() { - return thenStmt; - } - - public void setCondition(Expression condition) { - this.condition = condition; - } - - public void setElseStmt(Statement elseStmt) { - this.elseStmt = elseStmt; - } - - public void setThenStmt(Statement thenStmt) { - this.thenStmt = thenStmt; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/stmt/LabeledStmt.java b/stubparser/src/org/checkerframework/stubparser/ast/stmt/LabeledStmt.java deleted file mode 100644 index 2fbf4c716ec..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/stmt/LabeledStmt.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 04/11/2006 - */ -package org.checkerframework.stubparser.ast.stmt; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class LabeledStmt extends Statement { - - private String label; - - private Statement stmt; - - public LabeledStmt() { - } - - public LabeledStmt(String label, Statement stmt) { - this.label = label; - this.stmt = stmt; - } - - public LabeledStmt(int beginLine, int beginColumn, int endLine, int endColumn, String label, Statement stmt) { - super(beginLine, beginColumn, endLine, endColumn); - this.label = label; - this.stmt = stmt; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public String getLabel() { - return label; - } - - public Statement getStmt() { - return stmt; - } - - public void setLabel(String label) { - this.label = label; - } - - public void setStmt(Statement stmt) { - this.stmt = stmt; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/stmt/ReturnStmt.java b/stubparser/src/org/checkerframework/stubparser/ast/stmt/ReturnStmt.java deleted file mode 100644 index 617e34f2da0..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/stmt/ReturnStmt.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 04/11/2006 - */ -package org.checkerframework.stubparser.ast.stmt; - -import org.checkerframework.stubparser.ast.expr.Expression; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class ReturnStmt extends Statement { - - private Expression expr; - - public ReturnStmt() { - } - - public ReturnStmt(Expression expr) { - this.expr = expr; - } - - public ReturnStmt(int beginLine, int beginColumn, int endLine, int endColumn, Expression expr) { - super(beginLine, beginColumn, endLine, endColumn); - this.expr = expr; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getExpr() { - return expr; - } - - public void setExpr(Expression expr) { - this.expr = expr; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/stmt/Statement.java b/stubparser/src/org/checkerframework/stubparser/ast/stmt/Statement.java deleted file mode 100644 index 1f7b703d543..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/stmt/Statement.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 03/11/2006 - */ -package org.checkerframework.stubparser.ast.stmt; - -import org.checkerframework.stubparser.ast.Node; - -/** - * @author Julio Vilmar Gesser - */ -public abstract class Statement extends Node { - - public Statement() { - } - - public Statement(int beginLine, int beginColumn, int endLine, int endColumn) { - super(beginLine, beginColumn, endLine, endColumn); - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/stmt/SwitchEntryStmt.java b/stubparser/src/org/checkerframework/stubparser/ast/stmt/SwitchEntryStmt.java deleted file mode 100644 index 48a6f833f22..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/stmt/SwitchEntryStmt.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 04/11/2006 - */ -package org.checkerframework.stubparser.ast.stmt; - -import java.util.List; - -import org.checkerframework.stubparser.ast.expr.Expression; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class SwitchEntryStmt extends Statement { - - private Expression label; - - private List stmts; - - public SwitchEntryStmt() { - } - - public SwitchEntryStmt(Expression label, List stmts) { - this.label = label; - this.stmts = stmts; - } - - public SwitchEntryStmt(int beginLine, int beginColumn, int endLine, int endColumn, Expression label, List stmts) { - super(beginLine, beginColumn, endLine, endColumn); - this.label = label; - this.stmts = stmts; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getLabel() { - return label; - } - - public List getStmts() { - return stmts; - } - - public void setLabel(Expression label) { - this.label = label; - } - - public void setStmts(List stmts) { - this.stmts = stmts; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/stmt/SwitchStmt.java b/stubparser/src/org/checkerframework/stubparser/ast/stmt/SwitchStmt.java deleted file mode 100644 index acedf01fb56..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/stmt/SwitchStmt.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 04/11/2006 - */ -package org.checkerframework.stubparser.ast.stmt; - -import java.util.List; - -import org.checkerframework.stubparser.ast.expr.Expression; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class SwitchStmt extends Statement { - - private Expression selector; - - private List entries; - - public SwitchStmt() { - } - - public SwitchStmt(Expression selector, List entries) { - this.selector = selector; - this.entries = entries; - } - - public SwitchStmt(int beginLine, int beginColumn, int endLine, int endColumn, Expression selector, List entries) { - super(beginLine, beginColumn, endLine, endColumn); - this.selector = selector; - this.entries = entries; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public List getEntries() { - return entries; - } - - public Expression getSelector() { - return selector; - } - - public void setEntries(List entries) { - this.entries = entries; - } - - public void setSelector(Expression selector) { - this.selector = selector; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/stmt/SynchronizedStmt.java b/stubparser/src/org/checkerframework/stubparser/ast/stmt/SynchronizedStmt.java deleted file mode 100644 index 0b38ec7ac64..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/stmt/SynchronizedStmt.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 18/11/2006 - */ -package org.checkerframework.stubparser.ast.stmt; - -import org.checkerframework.stubparser.ast.expr.Expression; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class SynchronizedStmt extends Statement { - - private Expression expr; - - private BlockStmt block; - - public SynchronizedStmt() { - } - - public SynchronizedStmt(Expression expr, BlockStmt block) { - this.expr = expr; - this.block = block; - } - - public SynchronizedStmt(int beginLine, int beginColumn, int endLine, int endColumn, Expression expr, BlockStmt block) { - super(beginLine, beginColumn, endLine, endColumn); - this.expr = expr; - this.block = block; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public BlockStmt getBlock() { - return block; - } - - public Expression getExpr() { - return expr; - } - - public void setBlock(BlockStmt block) { - this.block = block; - } - - public void setExpr(Expression expr) { - this.expr = expr; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/stmt/ThrowStmt.java b/stubparser/src/org/checkerframework/stubparser/ast/stmt/ThrowStmt.java deleted file mode 100644 index 7286595f88e..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/stmt/ThrowStmt.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 18/11/2006 - */ -package org.checkerframework.stubparser.ast.stmt; - -import org.checkerframework.stubparser.ast.expr.Expression; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class ThrowStmt extends Statement { - - private Expression expr; - - public ThrowStmt() { - } - - public ThrowStmt(Expression expr) { - this.expr = expr; - } - - public ThrowStmt(int beginLine, int beginColumn, int endLine, int endColumn, Expression expr) { - super(beginLine, beginColumn, endLine, endColumn); - this.expr = expr; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getExpr() { - return expr; - } - - public void setExpr(Expression expr) { - this.expr = expr; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/stmt/TryStmt.java b/stubparser/src/org/checkerframework/stubparser/ast/stmt/TryStmt.java deleted file mode 100644 index 3427485a88a..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/stmt/TryStmt.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 18/11/2006 - */ -package org.checkerframework.stubparser.ast.stmt; - -import java.util.List; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class TryStmt extends Statement { - - private BlockStmt tryBlock; - - private List catchs; - - private BlockStmt finallyBlock; - - public TryStmt() { - } - - public TryStmt(BlockStmt tryBlock, List catchs, BlockStmt finallyBlock) { - this.tryBlock = tryBlock; - this.catchs = catchs; - this.finallyBlock = finallyBlock; - } - - public TryStmt(int beginLine, int beginColumn, int endLine, int endColumn, BlockStmt tryBlock, List catchs, BlockStmt finallyBlock) { - super(beginLine, beginColumn, endLine, endColumn); - this.tryBlock = tryBlock; - this.catchs = catchs; - this.finallyBlock = finallyBlock; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public List getCatchs() { - return catchs; - } - - public BlockStmt getFinallyBlock() { - return finallyBlock; - } - - public BlockStmt getTryBlock() { - return tryBlock; - } - - public void setCatchs(List catchs) { - this.catchs = catchs; - } - - public void setFinallyBlock(BlockStmt finallyBlock) { - this.finallyBlock = finallyBlock; - } - - public void setTryBlock(BlockStmt tryBlock) { - this.tryBlock = tryBlock; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/stmt/TypeDeclarationStmt.java b/stubparser/src/org/checkerframework/stubparser/ast/stmt/TypeDeclarationStmt.java deleted file mode 100644 index ec7774b4069..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/stmt/TypeDeclarationStmt.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 04/11/2006 - */ -package org.checkerframework.stubparser.ast.stmt; - -import org.checkerframework.stubparser.ast.body.TypeDeclaration; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class TypeDeclarationStmt extends Statement { - - private TypeDeclaration typeDecl; - - public TypeDeclarationStmt() { - } - - public TypeDeclarationStmt(TypeDeclaration typeDecl) { - this.typeDecl = typeDecl; - } - - public TypeDeclarationStmt(int beginLine, int beginColumn, int endLine, int endColumn, TypeDeclaration typeDecl) { - super(beginLine, beginColumn, endLine, endColumn); - this.typeDecl = typeDecl; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public TypeDeclaration getTypeDeclaration() { - return typeDecl; - } - - public void setTypeDeclaration(TypeDeclaration typeDecl) { - this.typeDecl = typeDecl; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/stmt/WhileStmt.java b/stubparser/src/org/checkerframework/stubparser/ast/stmt/WhileStmt.java deleted file mode 100644 index 3b2a1f6d00a..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/stmt/WhileStmt.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 07/11/2006 - */ -package org.checkerframework.stubparser.ast.stmt; - -import org.checkerframework.stubparser.ast.expr.Expression; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class WhileStmt extends Statement { - - private Expression condition; - - private Statement body; - - public WhileStmt() { - } - - public WhileStmt(Expression condition, Statement body) { - this.condition = condition; - this.body = body; - } - - public WhileStmt(int beginLine, int beginColumn, int endLine, int endColumn, Expression condition, Statement body) { - super(beginLine, beginColumn, endLine, endColumn); - this.condition = condition; - this.body = body; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Statement getBody() { - return body; - } - - public Expression getCondition() { - return condition; - } - - public void setBody(Statement body) { - this.body = body; - } - - public void setCondition(Expression condition) { - this.condition = condition; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/type/ClassOrInterfaceType.java b/stubparser/src/org/checkerframework/stubparser/ast/type/ClassOrInterfaceType.java deleted file mode 100644 index ccde50f734c..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/type/ClassOrInterfaceType.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.type; - -import java.util.List; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class ClassOrInterfaceType extends Type { - - private ClassOrInterfaceType scope; - - private String name; - - private List typeArgs; - - public ClassOrInterfaceType() { - } - - public ClassOrInterfaceType(String name) { - this.name = name; - } - - public ClassOrInterfaceType(ClassOrInterfaceType scope, String name) { - this.scope = scope; - this.name = name; - } - - public ClassOrInterfaceType(int beginLine, int beginColumn, int endLine, int endColumn, ClassOrInterfaceType scope, String name, List typeArgs) { - super(beginLine, beginColumn, endLine, endColumn); - this.scope = scope; - this.name = name; - this.typeArgs = typeArgs; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public String getName() { - return name; - } - - public ClassOrInterfaceType getScope() { - return scope; - } - - public List getTypeArgs() { - return typeArgs; - } - - public void setName(String name) { - this.name = name; - } - - public void setScope(ClassOrInterfaceType scope) { - this.scope = scope; - } - - public void setTypeArgs(List typeArgs) { - this.typeArgs = typeArgs; - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/type/PrimitiveType.java b/stubparser/src/org/checkerframework/stubparser/ast/type/PrimitiveType.java deleted file mode 100644 index 143704e2977..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/type/PrimitiveType.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.type; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class PrimitiveType extends Type { - - public enum Primitive { - Boolean, Char, Byte, Short, Int, Long, Float, Double - } - - private Primitive type; - - public PrimitiveType() { - } - - public PrimitiveType(Primitive type) { - this.type = type; - } - - public PrimitiveType(int beginLine, int beginColumn, int endLine, int endColumn, Primitive type) { - super(beginLine, beginColumn, endLine, endColumn); - this.type = type; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Primitive getType() { - return type; - } - - public void setType(Primitive type) { - this.type = type; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/type/ReferenceType.java b/stubparser/src/org/checkerframework/stubparser/ast/type/ReferenceType.java deleted file mode 100644 index 776144c22e4..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/type/ReferenceType.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.type; - -import java.util.List; - -import org.checkerframework.stubparser.ast.expr.AnnotationExpr; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class ReferenceType extends Type { - - private Type type; - - private int arrayCount; - - private List> arrayAnnotations; - - public ReferenceType() { - } - - public ReferenceType(Type type) { - this.type = type; - } - - public ReferenceType(Type type, int arrayCount) { - this.type = type; - this.arrayCount = arrayCount; - } - - public ReferenceType(int beginLine, int beginColumn, int endLine, int endColumn, Type type, int arrayCount, List> arrayAnnotations) { - super(beginLine, beginColumn, endLine, endColumn); - this.type = type; - this.arrayCount = arrayCount; - this.arrayAnnotations = arrayAnnotations; - assert arrayCount == arrayAnnotations.size(); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public int getArrayCount() { - return arrayCount; - } - - public List> getArrayAnnotations() { - return arrayAnnotations; - } - - public List getAnnotationsAtLevel(int level) { - if (level == -1) { - return type.getAnnotations(); - } else { - return arrayAnnotations.get(level); - } - } - - public Type getType() { - return type; - } - - public void setArrayCount(int arrayCount) { - this.arrayCount = arrayCount; - } - - public void setArrayAnnotations(List> arrayAnnotations) { - this.arrayAnnotations = arrayAnnotations; - } - - public void setType(Type type) { - this.type = type; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/type/Type.java b/stubparser/src/org/checkerframework/stubparser/ast/type/Type.java deleted file mode 100644 index da1a9ca89a4..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/type/Type.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.type; - -import java.util.List; - -import org.checkerframework.stubparser.ast.Node; -import org.checkerframework.stubparser.ast.expr.AnnotationExpr; - -/** - * @author Julio Vilmar Gesser - */ -public abstract class Type extends Node { - - private List annotations; - - public Type() { - } - - public Type(int beginLine, int beginColumn, int endLine, int endColumn) { - super(beginLine, beginColumn, endLine, endColumn); - } - - public void setAnnotations(List annotations) { - this.annotations = annotations; - } - - public List getAnnotations() { - return annotations; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/type/VoidType.java b/stubparser/src/org/checkerframework/stubparser/ast/type/VoidType.java deleted file mode 100644 index 6b7dd3fa089..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/type/VoidType.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.type; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class VoidType extends Type { - - public VoidType() { - } - - public VoidType(int beginLine, int beginColumn, int endLine, int endColumn) { - super(beginLine, beginColumn, endLine, endColumn); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/type/WildcardType.java b/stubparser/src/org/checkerframework/stubparser/ast/type/WildcardType.java deleted file mode 100644 index def3bef8b7e..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/type/WildcardType.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.type; - -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class WildcardType extends Type { - - private ReferenceType ext; - - private ReferenceType sup; - - public WildcardType() { - } - - public WildcardType(ReferenceType ext) { - this.ext = ext; - } - - public WildcardType(ReferenceType ext, ReferenceType sup) { - this.ext = ext; - this.sup = sup; - } - - public WildcardType(int beginLine, int beginColumn, int endLine, int endColumn, ReferenceType ext, ReferenceType sup) { - super(beginLine, beginColumn, endLine, endColumn); - this.ext = ext; - this.sup = sup; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public ReferenceType getExtends() { - return ext; - } - - public ReferenceType getSuper() { - return sup; - } - - public void setExtends(ReferenceType ext) { - this.ext = ext; - } - - public void setSuper(ReferenceType sup) { - this.sup = sup; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/visitor/DumpVisitor.java b/stubparser/src/org/checkerframework/stubparser/ast/visitor/DumpVisitor.java deleted file mode 100644 index e63393d5702..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/visitor/DumpVisitor.java +++ /dev/null @@ -1,1491 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.visitor; - -import java.util.Iterator; -import java.util.List; - -import org.checkerframework.stubparser.ast.BlockComment; -import org.checkerframework.stubparser.ast.CompilationUnit; -import org.checkerframework.stubparser.ast.ImportDeclaration; -import org.checkerframework.stubparser.ast.IndexUnit; -import org.checkerframework.stubparser.ast.LineComment; -import org.checkerframework.stubparser.ast.PackageDeclaration; -import org.checkerframework.stubparser.ast.TypeParameter; -import org.checkerframework.stubparser.ast.body.AnnotationDeclaration; -import org.checkerframework.stubparser.ast.body.AnnotationMemberDeclaration; -import org.checkerframework.stubparser.ast.body.BodyDeclaration; -import org.checkerframework.stubparser.ast.body.ClassOrInterfaceDeclaration; -import org.checkerframework.stubparser.ast.body.ConstructorDeclaration; -import org.checkerframework.stubparser.ast.body.EmptyMemberDeclaration; -import org.checkerframework.stubparser.ast.body.EmptyTypeDeclaration; -import org.checkerframework.stubparser.ast.body.EnumConstantDeclaration; -import org.checkerframework.stubparser.ast.body.EnumDeclaration; -import org.checkerframework.stubparser.ast.body.FieldDeclaration; -import org.checkerframework.stubparser.ast.body.InitializerDeclaration; -import org.checkerframework.stubparser.ast.body.JavadocComment; -import org.checkerframework.stubparser.ast.body.MethodDeclaration; -import org.checkerframework.stubparser.ast.body.ModifierSet; -import org.checkerframework.stubparser.ast.body.Parameter; -import org.checkerframework.stubparser.ast.body.TypeDeclaration; -import org.checkerframework.stubparser.ast.body.VariableDeclarator; -import org.checkerframework.stubparser.ast.body.VariableDeclaratorId; -import org.checkerframework.stubparser.ast.expr.AnnotationExpr; -import org.checkerframework.stubparser.ast.expr.ArrayAccessExpr; -import org.checkerframework.stubparser.ast.expr.ArrayCreationExpr; -import org.checkerframework.stubparser.ast.expr.ArrayInitializerExpr; -import org.checkerframework.stubparser.ast.expr.AssignExpr; -import org.checkerframework.stubparser.ast.expr.BinaryExpr; -import org.checkerframework.stubparser.ast.expr.BooleanLiteralExpr; -import org.checkerframework.stubparser.ast.expr.CastExpr; -import org.checkerframework.stubparser.ast.expr.CharLiteralExpr; -import org.checkerframework.stubparser.ast.expr.ClassExpr; -import org.checkerframework.stubparser.ast.expr.ConditionalExpr; -import org.checkerframework.stubparser.ast.expr.DoubleLiteralExpr; -import org.checkerframework.stubparser.ast.expr.EnclosedExpr; -import org.checkerframework.stubparser.ast.expr.Expression; -import org.checkerframework.stubparser.ast.expr.FieldAccessExpr; -import org.checkerframework.stubparser.ast.expr.InstanceOfExpr; -import org.checkerframework.stubparser.ast.expr.IntegerLiteralExpr; -import org.checkerframework.stubparser.ast.expr.IntegerLiteralMinValueExpr; -import org.checkerframework.stubparser.ast.expr.LongLiteralExpr; -import org.checkerframework.stubparser.ast.expr.LongLiteralMinValueExpr; -import org.checkerframework.stubparser.ast.expr.MarkerAnnotationExpr; -import org.checkerframework.stubparser.ast.expr.MemberValuePair; -import org.checkerframework.stubparser.ast.expr.MethodCallExpr; -import org.checkerframework.stubparser.ast.expr.NameExpr; -import org.checkerframework.stubparser.ast.expr.NormalAnnotationExpr; -import org.checkerframework.stubparser.ast.expr.NullLiteralExpr; -import org.checkerframework.stubparser.ast.expr.ObjectCreationExpr; -import org.checkerframework.stubparser.ast.expr.QualifiedNameExpr; -import org.checkerframework.stubparser.ast.expr.SingleMemberAnnotationExpr; -import org.checkerframework.stubparser.ast.expr.StringLiteralExpr; -import org.checkerframework.stubparser.ast.expr.SuperExpr; -import org.checkerframework.stubparser.ast.expr.ThisExpr; -import org.checkerframework.stubparser.ast.expr.UnaryExpr; -import org.checkerframework.stubparser.ast.expr.VariableDeclarationExpr; -import org.checkerframework.stubparser.ast.stmt.AssertStmt; -import org.checkerframework.stubparser.ast.stmt.BlockStmt; -import org.checkerframework.stubparser.ast.stmt.BreakStmt; -import org.checkerframework.stubparser.ast.stmt.CatchClause; -import org.checkerframework.stubparser.ast.stmt.ContinueStmt; -import org.checkerframework.stubparser.ast.stmt.DoStmt; -import org.checkerframework.stubparser.ast.stmt.EmptyStmt; -import org.checkerframework.stubparser.ast.stmt.ExplicitConstructorInvocationStmt; -import org.checkerframework.stubparser.ast.stmt.ExpressionStmt; -import org.checkerframework.stubparser.ast.stmt.ForStmt; -import org.checkerframework.stubparser.ast.stmt.ForeachStmt; -import org.checkerframework.stubparser.ast.stmt.IfStmt; -import org.checkerframework.stubparser.ast.stmt.LabeledStmt; -import org.checkerframework.stubparser.ast.stmt.ReturnStmt; -import org.checkerframework.stubparser.ast.stmt.Statement; -import org.checkerframework.stubparser.ast.stmt.SwitchEntryStmt; -import org.checkerframework.stubparser.ast.stmt.SwitchStmt; -import org.checkerframework.stubparser.ast.stmt.SynchronizedStmt; -import org.checkerframework.stubparser.ast.stmt.ThrowStmt; -import org.checkerframework.stubparser.ast.stmt.TryStmt; -import org.checkerframework.stubparser.ast.stmt.TypeDeclarationStmt; -import org.checkerframework.stubparser.ast.stmt.WhileStmt; -import org.checkerframework.stubparser.ast.type.ClassOrInterfaceType; -import org.checkerframework.stubparser.ast.type.PrimitiveType; -import org.checkerframework.stubparser.ast.type.ReferenceType; -import org.checkerframework.stubparser.ast.type.Type; -import org.checkerframework.stubparser.ast.type.VoidType; -import org.checkerframework.stubparser.ast.type.WildcardType; - -/** - * Builds a string representation of any AST node for printing. - * - * @author Julio Vilmar Gesser - */ - -public final class DumpVisitor implements VoidVisitor { - - // Writes to StringBuilder buffer. - private static class SourcePrinter { - - private int level = 0; - - private boolean indented = false; - - private final StringBuilder buf = new StringBuilder(); - - public void indent() { - level++; - } - - public void unindent() { - level--; - } - - private void makeIndent() { - for (int i = 0; i < level; i++) { - buf.append(" "); - } - } - - public void print(String arg) { - if (!indented) { - makeIndent(); - indented = true; - } - buf.append(arg); - } - - public void printLn(String arg) { - print(arg); - printLn(); - } - - public void printLn() { - buf.append("\n"); - indented = false; - } - - public String getSource() { - return buf.toString(); - } - - /*@org.checkerframework.dataflow.qual.SideEffectFree*/ - @Override - public String toString() { - return getSource(); - } - } - - private final SourcePrinter printer = new SourcePrinter(); - - /** Return buffered contents of SourcePrinter. */ - public String getSource() { - return printer.getSource(); - } - - /** - * Print Java modifiers indicated by the bit flags in the argument. - * - * @param modifiers the Java modifiers represented as a set of bit flags - */ - private void printModifiers(int modifiers) { - if (ModifierSet.isPrivate(modifiers)) { - printer.print("private "); - } - if (ModifierSet.isProtected(modifiers)) { - printer.print("protected "); - } - if (ModifierSet.isPublic(modifiers)) { - printer.print("public "); - } - if (ModifierSet.isAbstract(modifiers)) { - printer.print("abstract "); - } - if (ModifierSet.isStatic(modifiers)) { - printer.print("static "); - } - if (ModifierSet.isFinal(modifiers)) { - printer.print("final "); - } - if (ModifierSet.isNative(modifiers)) { - printer.print("native "); - } - if (ModifierSet.isStrictfp(modifiers)) { - printer.print("strictfp "); - } - if (ModifierSet.isSynchronized(modifiers)) { - printer.print("synchronized "); - } - if (ModifierSet.isTransient(modifiers)) { - printer.print("transient "); - } - if (ModifierSet.isVolatile(modifiers)) { - printer.print("volatile "); - } - } - - /** - * Print out declarations from a stub file. - * - * @param members list of declarations - * @param arg argument provided to the calling visitor method - */ - private void printMembers(List members, Object arg) { - for (BodyDeclaration member : members) { - printer.printLn(); - member.accept(this, arg); - printer.printLn(); - } - } - - /** - * Print a list of annotations on separate lines, ending with a newline. - * - * @param annotations list of {@link AnnotationExpr annotation expressions} - * @param arg argument provided to the calling visitor method - */ - private void printMemberAnnotations(List annotations, Object arg) { - if (annotations != null) { - for (AnnotationExpr a : annotations) { - a.accept(this, arg); - printer.printLn(); - } - } - } - - /** - * Print a list of annotations, including a trailing space. - * - * @param annotations list of {@link AnnotationExpr annotation expressions} - * @param arg argument provided to the calling visitor method - */ - private void printAnnotations(List annotations, - Object arg) { - printAnnotations(annotations, arg, false); - } - - /** - * Print a list of annotations. The final parameter determines whether to - * issue a leading (if true) or trailing (if false) space. - * - * @param annotations list of {@link AnnotationExpr annotation expressions} - * @param arg argument provided to the calling visitor method - * @param isOnReceiver whether annotation is on a method receiver - */ - private void printAnnotations(List annotations, - Object arg, boolean isOnReceiver) { - if (annotations != null) { - Iterator i = annotations.iterator(); - if (i.hasNext()) { - AnnotationExpr a = i.next(); - if (isOnReceiver) { printer.print(" "); } - a.accept(this, arg); - while (i.hasNext()) { - printer.print(" "); - a = i.next(); - a.accept(this, arg); - } - if (!isOnReceiver) { printer.print(" "); } - } - } - } - - /** - * Print a list of type arguments in between angle brackets. - * - * @param args type arguments - * @param arg argument provided to the calling visitor method - */ - private void printTypeArgs(List args, Object arg) { - if (args != null) { - printer.print("<"); - for (Iterator i = args.iterator(); i.hasNext();) { - Type t = i.next(); - t.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - printer.print(">"); - } - } - - /** - * Print a list of type parameters in between angle brackets. - * - * @param args type parameters - * @param arg argument provided to the calling visitor method - */ - private void printTypeParameters(List args, Object arg) { - if (args != null) { - printer.print("<"); - for (Iterator i = args.iterator(); i.hasNext();) { - TypeParameter t = i.next(); - t.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - printer.print(">"); - } - } - - /** - * Print a list of method arguments in between parentheses. - * - * @param args method arguments - * @param arg argument provided to the calling visitor method - */ - private void printArguments(List args, Object arg) { - printer.print("("); - if (args != null) { - for (Iterator i = args.iterator(); i.hasNext();) { - Expression e = i.next(); - e.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - printer.print(")"); - } - - /** - * Print a javadoc comment. - * - * @param javadoc comment - * @param arg argument provided to the calling visitor method - */ - private void printJavadoc(JavadocComment javadoc, Object arg) { - if (javadoc != null) { - javadoc.accept(this, arg); - } - } - - // Visitor interface implementation follows - - @Override - public void visit(IndexUnit n, Object arg) { - for (CompilationUnit unit : n.getCompilationUnits()) { - visit(unit, arg); - printer.printLn(); - printer.printLn(); - } - } - - @Override - public void visit(CompilationUnit n, Object arg) { - if (n.getPackage() != null) { - n.getPackage().accept(this, arg); - } - if (n.getImports() != null) { - for (ImportDeclaration i : n.getImports()) { - i.accept(this, arg); - } - printer.printLn(); - } - if (n.getTypes() != null) { - for (Iterator i = n.getTypes().iterator(); i.hasNext();) { - i.next().accept(this, arg); - printer.printLn(); - if (i.hasNext()) { - printer.printLn(); - } - } - } - } - - @Override - public void visit(PackageDeclaration n, Object arg) { - printMemberAnnotations(n.getAnnotations(), arg); - printer.print("package "); - n.getName().accept(this, arg); - printer.printLn(";"); - printer.printLn(); - } - - @Override - public void visit(NameExpr n, Object arg) { - printer.print(n.getName()); - } - - @Override - public void visit(QualifiedNameExpr n, Object arg) { - n.getQualifier().accept(this, arg); - printer.print("."); - printer.print(n.getName()); - } - - @Override - public void visit(ImportDeclaration n, Object arg) { - printer.print("import "); - if (n.isStatic()) { - printer.print("static "); - } - n.getName().accept(this, arg); - if (n.isAsterisk()) { - printer.print(".*"); - } - printer.printLn(";"); - } - - @Override - public void visit(ClassOrInterfaceDeclaration n, Object arg) { - printJavadoc(n.getJavaDoc(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - - if (n.isInterface()) { - printer.print("interface "); - } else { - printer.print("class "); - } - - printer.print(n.getName()); - - printTypeParameters(n.getTypeParameters(), arg); - - if (n.getExtends() != null) { - printer.print(" extends "); - for (Iterator i = n.getExtends().iterator(); i.hasNext();) { - ClassOrInterfaceType c = i.next(); - c.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - - if (n.getImplements() != null) { - printer.print(" implements "); - for (Iterator i = n.getImplements().iterator(); i.hasNext();) { - ClassOrInterfaceType c = i.next(); - c.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - - printer.printLn(" {"); - printer.indent(); - if (n.getMembers() != null) { - printMembers(n.getMembers(), arg); - } - printer.unindent(); - printer.print("}"); - } - - @Override - public void visit(EmptyTypeDeclaration n, Object arg) { - printJavadoc(n.getJavaDoc(), arg); - printer.print(";"); - } - - @Override - public void visit(JavadocComment n, Object arg) { - printer.print("/**"); - printer.print(n.getContent()); - printer.printLn("*/"); - } - - @Override - public void visit(ClassOrInterfaceType n, Object arg) { - printAnnotations(n.getAnnotations(), arg); - if (n.getScope() != null) { - n.getScope().accept(this, arg); - printer.print("."); - } - printer.print(n.getName()); - printTypeArgs(n.getTypeArgs(), arg); - } - - @Override - public void visit(TypeParameter n, Object arg) { - printAnnotations(n.getAnnotations(), arg); - printer.print(n.getName()); - if (n.getTypeBound() != null) { - printer.print(" extends "); - for (Iterator i = n.getTypeBound().iterator(); i.hasNext();) { - ClassOrInterfaceType c = i.next(); - c.accept(this, arg); - if (i.hasNext()) { - printer.print(" & "); - } - } - } - } - - @Override - public void visit(PrimitiveType n, Object arg) { - printAnnotations(n.getAnnotations(), arg); - - switch (n.getType()) { - case Boolean: - printer.print("boolean"); - break; - case Byte: - printer.print("byte"); - break; - case Char: - printer.print("char"); - break; - case Double: - printer.print("double"); - break; - case Float: - printer.print("float"); - break; - case Int: - printer.print("int"); - break; - case Long: - printer.print("long"); - break; - case Short: - printer.print("short"); - break; - } - } - - @Override - public void visit(ReferenceType n, Object arg) { - printAnnotations(n.getAnnotations(), arg); - - n.getType().accept(this, arg); - for (int i = 0; i < n.getArrayCount(); i++) { - if (!n.getAnnotationsAtLevel(i).isEmpty()) { - printer.print(" "); - printAnnotations(n.getAnnotationsAtLevel(i), arg); - } - printer.print("[]"); - } - } - - @Override - public void visit(WildcardType n, Object arg) { - printAnnotations(n.getAnnotations(), arg); - printer.print("?"); - if (n.getExtends() != null) { - printer.print(" extends "); - n.getExtends().accept(this, arg); - } - if (n.getSuper() != null) { - printer.print(" super "); - n.getSuper().accept(this, arg); - } - } - - @Override - public void visit(FieldDeclaration n, Object arg) { - printJavadoc(n.getJavaDoc(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - n.getType().accept(this, arg); - - printer.print(" "); - for (Iterator i = n.getVariables().iterator(); i.hasNext();) { - VariableDeclarator var = i.next(); - var.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - - printer.print(";"); - } - - @Override - public void visit(VariableDeclarator n, Object arg) { - n.getId().accept(this, arg); - if (n.getInit() != null) { - printer.print(" = "); - n.getInit().accept(this, arg); - } - } - - @Override - public void visit(VariableDeclaratorId n, Object arg) { - printer.print(n.getName()); - for (int i = 0; i < n.getArrayCount(); i++) { - printer.print("[]"); - } - } - - @Override - public void visit(ArrayInitializerExpr n, Object arg) { - printer.print("{"); - if (n.getValues() != null) { - printer.print(" "); - for (Iterator i = n.getValues().iterator(); i.hasNext();) { - Expression expr = i.next(); - expr.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - printer.print(" "); - } - printer.print("}"); - } - - @Override - public void visit(VoidType n, Object arg) { - printer.print("void"); - } - - @Override - public void visit(ArrayAccessExpr n, Object arg) { - n.getName().accept(this, arg); - printer.print("["); - n.getIndex().accept(this, arg); - printer.print("]"); - } - - @Override - public void visit(ArrayCreationExpr n, Object arg) { - printer.print("new "); - n.getType().accept(this, arg); - - if (n.getDimensions() != null) { - for (Expression dim : n.getDimensions()) { - printer.print("["); - dim.accept(this, arg); - printer.print("]"); - } - for (int i = 0; i < n.getArrayCount(); i++) { - printer.print("[]"); - } - } else { - for (int i = 0; i < n.getArrayCount(); i++) { - printer.print("[]"); - } - printer.print(" "); - n.getInitializer().accept(this, arg); - } - } - - @Override - public void visit(AssignExpr n, Object arg) { - n.getTarget().accept(this, arg); - printer.print(" "); - switch (n.getOperator()) { - case assign: - printer.print("="); - break; - case and: - printer.print("&="); - break; - case or: - printer.print("|="); - break; - case xor: - printer.print("^="); - break; - case plus: - printer.print("+="); - break; - case minus: - printer.print("-="); - break; - case rem: - printer.print("%="); - break; - case slash: - printer.print("/="); - break; - case star: - printer.print("*="); - break; - case lShift: - printer.print("<<="); - break; - case rSignedShift: - printer.print(">>="); - break; - case rUnsignedShift: - printer.print(">>>="); - break; - } - printer.print(" "); - n.getValue().accept(this, arg); - } - - @Override - public void visit(BinaryExpr n, Object arg) { - n.getLeft().accept(this, arg); - printer.print(" "); - switch (n.getOperator()) { - case or: - printer.print("||"); - break; - case and: - printer.print("&&"); - break; - case binOr: - printer.print("|"); - break; - case binAnd: - printer.print("&"); - break; - case xor: - printer.print("^"); - break; - case equals: - printer.print("=="); - break; - case notEquals: - printer.print("!="); - break; - case less: - printer.print("<"); - break; - case greater: - printer.print(">"); - break; - case lessEquals: - printer.print("<="); - break; - case greaterEquals: - printer.print(">="); - break; - case lShift: - printer.print("<<"); - break; - case rSignedShift: - printer.print(">>"); - break; - case rUnsignedShift: - printer.print(">>>"); - break; - case plus: - printer.print("+"); - break; - case minus: - printer.print("-"); - break; - case times: - printer.print("*"); - break; - case divide: - printer.print("/"); - break; - case remainder: - printer.print("%"); - break; - } - printer.print(" "); - n.getRight().accept(this, arg); - } - - @Override - public void visit(CastExpr n, Object arg) { - printer.print("("); - n.getType().accept(this, arg); - printer.print(") "); - n.getExpr().accept(this, arg); - } - - @Override - public void visit(ClassExpr n, Object arg) { - n.getType().accept(this, arg); - printer.print(".class"); - } - - @Override - public void visit(ConditionalExpr n, Object arg) { - n.getCondition().accept(this, arg); - printer.print(" ? "); - n.getThenExpr().accept(this, arg); - printer.print(" : "); - n.getElseExpr().accept(this, arg); - } - - @Override - public void visit(EnclosedExpr n, Object arg) { - printer.print("("); - n.getInner().accept(this, arg); - printer.print(")"); - } - - @Override - public void visit(FieldAccessExpr n, Object arg) { - n.getScope().accept(this, arg); - printer.print("."); - printer.print(n.getField()); - } - - @Override - public void visit(InstanceOfExpr n, Object arg) { - n.getExpr().accept(this, arg); - printer.print(" instanceof "); - n.getType().accept(this, arg); - } - - @Override - public void visit(CharLiteralExpr n, Object arg) { - printer.print("'"); - printer.print(n.getValue()); - printer.print("'"); - } - - @Override - public void visit(DoubleLiteralExpr n, Object arg) { - printer.print(n.getValue()); - } - - @Override - public void visit(IntegerLiteralExpr n, Object arg) { - printer.print(n.getValue()); - } - - @Override - public void visit(LongLiteralExpr n, Object arg) { - printer.print(n.getValue()); - } - - @Override - public void visit(IntegerLiteralMinValueExpr n, Object arg) { - printer.print(n.getValue()); - } - - @Override - public void visit(LongLiteralMinValueExpr n, Object arg) { - printer.print(n.getValue()); - } - - @Override - public void visit(StringLiteralExpr n, Object arg) { - printer.print("\""); - printer.print(n.getValue()); - printer.print("\""); - } - - @Override - public void visit(BooleanLiteralExpr n, Object arg) { - printer.print(String.valueOf(n.getValue())); - } - - @Override - public void visit(NullLiteralExpr n, Object arg) { - printer.print("null"); - } - - @Override - public void visit(ThisExpr n, Object arg) { - if (n.getClassExpr() != null) { - n.getClassExpr().accept(this, arg); - printer.print("."); - } - printer.print("this"); - } - - @Override - public void visit(SuperExpr n, Object arg) { - if (n.getClassExpr() != null) { - n.getClassExpr().accept(this, arg); - printer.print("."); - } - printer.print("super"); - } - - @Override - public void visit(MethodCallExpr n, Object arg) { - if (n.getScope() != null) { - n.getScope().accept(this, arg); - printer.print("."); - } - printTypeArgs(n.getTypeArgs(), arg); - printer.print(n.getName()); - printArguments(n.getArgs(), arg); - } - - @Override - public void visit(ObjectCreationExpr n, Object arg) { - if (n.getScope() != null) { - n.getScope().accept(this, arg); - printer.print("."); - } - - printer.print("new "); - - printTypeArgs(n.getTypeArgs(), arg); - n.getType().accept(this, arg); - - printArguments(n.getArgs(), arg); - - if (n.getAnonymousClassBody() != null) { - printer.printLn(" {"); - printer.indent(); - printMembers(n.getAnonymousClassBody(), arg); - printer.unindent(); - printer.print("}"); - } - } - - @Override - public void visit(UnaryExpr n, Object arg) { - switch (n.getOperator()) { - case positive: - printer.print("+"); - break; - case negative: - printer.print("-"); - break; - case inverse: - printer.print("~"); - break; - case not: - printer.print("!"); - break; - case preIncrement: - printer.print("++"); - break; - case preDecrement: - printer.print("--"); - break; - default: - // Postfix operations handled below - } - - n.getExpr().accept(this, arg); - - switch (n.getOperator()) { - case posIncrement: - printer.print("++"); - break; - case posDecrement: - printer.print("--"); - break; - default: - // Prefix operations handled above - } - } - - @Override - public void visit(ConstructorDeclaration n, Object arg) { - printJavadoc(n.getJavaDoc(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - - if (n.getTypeParameters() != null) { - printTypeParameters(n.getTypeParameters(), arg); - printer.print(" "); - } - printer.print(n.getName()); - - printer.print("("); - if (n.getParameters() != null) { - for (Iterator i = n.getParameters().iterator(); i.hasNext();) { - Parameter p = i.next(); - p.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - printer.print(")"); - - printAnnotations(n.getReceiverAnnotations(), arg, true); - - if (n.getThrows() != null) { - printer.print(" throws "); - for (Iterator i = n.getThrows().iterator(); i.hasNext();) { - NameExpr name = i.next(); - name.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - - if (n.getBlock() == null) { - printer.print(";"); - } else { - printer.print(" "); - n.getBlock().accept(this, arg); - } - } - - @Override - public void visit(MethodDeclaration n, Object arg) { - printJavadoc(n.getJavaDoc(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - - printTypeParameters(n.getTypeParameters(), arg); - if (n.getTypeParameters() != null) { - printer.print(" "); - } - - n.getType().accept(this, arg); - printer.print(" "); - printer.print(n.getName()); - - printer.print("("); - if (n.getParameters() != null) { - for (Iterator i = n.getParameters().iterator(); i.hasNext();) { - Parameter p = i.next(); - p.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - printer.print(")"); - - for (int i = 0; i < n.getArrayCount(); i++) { - printer.print("[]"); - } - - printAnnotations(n.getReceiverAnnotations(), arg, true); - - if (n.getThrows() != null) { - printer.print(" throws "); - for (Iterator i = n.getThrows().iterator(); i.hasNext();) { - NameExpr name = i.next(); - name.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - if (n.getBody() == null) { - printer.print(";"); - } else { - printer.print(" "); - n.getBody().accept(this, arg); - } - } - - @Override - public void visit(Parameter n, Object arg) { - printAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - - n.getType().accept(this, arg); - if (n.isVarArgs()) { - printer.print("..."); - } - printer.print(" "); - n.getId().accept(this, arg); - } - - @Override - public void visit(ExplicitConstructorInvocationStmt n, Object arg) { - if (n.isThis()) { - printTypeArgs(n.getTypeArgs(), arg); - printer.print("this"); - } else { - if (n.getExpr() != null) { - n.getExpr().accept(this, arg); - printer.print("."); - } - printTypeArgs(n.getTypeArgs(), arg); - printer.print("super"); - } - printArguments(n.getArgs(), arg); - printer.print(";"); - } - - @Override - public void visit(VariableDeclarationExpr n, Object arg) { - printMemberAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - - n.getType().accept(this, arg); - printer.print(" "); - - for (Iterator i = n.getVars().iterator(); i.hasNext();) { - VariableDeclarator v = i.next(); - v.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - - @Override - public void visit(TypeDeclarationStmt n, Object arg) { - n.getTypeDeclaration().accept(this, arg); - } - - @Override - public void visit(AssertStmt n, Object arg) { - printer.print("assert "); - n.getCheck().accept(this, arg); - if (n.getMessage() != null) { - printer.print(" : "); - n.getMessage().accept(this, arg); - } - printer.print(";"); - } - - @Override - public void visit(BlockStmt n, Object arg) { - printer.printLn("{"); - if (n.getStmts() != null) { - printer.indent(); - for (Statement s : n.getStmts()) { - s.accept(this, arg); - printer.printLn(); - } - printer.unindent(); - } - printer.print("}"); - - } - - @Override - public void visit(LabeledStmt n, Object arg) { - printer.print(n.getLabel()); - printer.print(": "); - n.getStmt().accept(this, arg); - } - - @Override - public void visit(EmptyStmt n, Object arg) { - printer.print(";"); - } - - @Override - public void visit(ExpressionStmt n, Object arg) { - n.getExpression().accept(this, arg); - printer.print(";"); - } - - @Override - public void visit(SwitchStmt n, Object arg) { - printer.print("switch("); - n.getSelector().accept(this, arg); - printer.printLn(") {"); - if (n.getEntries() != null) { - printer.indent(); - for (SwitchEntryStmt e : n.getEntries()) { - e.accept(this, arg); - } - printer.unindent(); - } - printer.print("}"); - - } - - @Override - public void visit(SwitchEntryStmt n, Object arg) { - if (n.getLabel() != null) { - printer.print("case "); - n.getLabel().accept(this, arg); - printer.print(":"); - } else { - printer.print("default:"); - } - printer.printLn(); - printer.indent(); - if (n.getStmts() != null) { - for (Statement s : n.getStmts()) { - s.accept(this, arg); - printer.printLn(); - } - } - printer.unindent(); - } - - @Override - public void visit(BreakStmt n, Object arg) { - printer.print("break"); - if (n.getId() != null) { - printer.print(" "); - printer.print(n.getId()); - } - printer.print(";"); - } - - @Override - public void visit(ReturnStmt n, Object arg) { - printer.print("return"); - if (n.getExpr() != null) { - printer.print(" "); - n.getExpr().accept(this, arg); - } - printer.print(";"); - } - - @Override - public void visit(EnumDeclaration n, Object arg) { - printJavadoc(n.getJavaDoc(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - - printer.print("enum "); - printer.print(n.getName()); - - if (n.getImplements() != null) { - printer.print(" implements "); - for (Iterator i = n.getImplements().iterator(); i.hasNext();) { - ClassOrInterfaceType c = i.next(); - c.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - - printer.printLn(" {"); - printer.indent(); - if (n.getEntries() != null) { - printer.printLn(); - for (Iterator i = n.getEntries().iterator(); i.hasNext();) { - EnumConstantDeclaration e = i.next(); - e.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - if (n.getMembers() != null) { - printer.printLn(";"); - printMembers(n.getMembers(), arg); - } else { - if (n.getEntries() != null) { - printer.printLn(); - } - } - printer.unindent(); - printer.print("}"); - } - - @Override - public void visit(EnumConstantDeclaration n, Object arg) { - printJavadoc(n.getJavaDoc(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printer.print(n.getName()); - - if (n.getArgs() != null) { - printArguments(n.getArgs(), arg); - } - - if (n.getClassBody() != null) { - printer.printLn(" {"); - printer.indent(); - printMembers(n.getClassBody(), arg); - printer.unindent(); - printer.printLn("}"); - } - } - - @Override - public void visit(EmptyMemberDeclaration n, Object arg) { - printJavadoc(n.getJavaDoc(), arg); - printer.print(";"); - } - - @Override - public void visit(InitializerDeclaration n, Object arg) { - printJavadoc(n.getJavaDoc(), arg); - if (n.isStatic()) { - printer.print("static "); - } - n.getBlock().accept(this, arg); - } - - @Override - public void visit(IfStmt n, Object arg) { - printer.print("if ("); - n.getCondition().accept(this, arg); - printer.print(") "); - n.getThenStmt().accept(this, arg); - if (n.getElseStmt() != null) { - printer.print(" else "); - n.getElseStmt().accept(this, arg); - } - } - - @Override - public void visit(WhileStmt n, Object arg) { - printer.print("while ("); - n.getCondition().accept(this, arg); - printer.print(") "); - n.getBody().accept(this, arg); - } - - @Override - public void visit(ContinueStmt n, Object arg) { - printer.print("continue"); - if (n.getId() != null) { - printer.print(" "); - printer.print(n.getId()); - } - printer.print(";"); - } - - @Override - public void visit(DoStmt n, Object arg) { - printer.print("do "); - n.getBody().accept(this, arg); - printer.print(" while ("); - n.getCondition().accept(this, arg); - printer.print(");"); - } - - @Override - public void visit(ForeachStmt n, Object arg) { - printer.print("for ("); - n.getVariable().accept(this, arg); - printer.print(" : "); - n.getIterable().accept(this, arg); - printer.print(") "); - n.getBody().accept(this, arg); - } - - @Override - public void visit(ForStmt n, Object arg) { - printer.print("for ("); - if (n.getInit() != null) { - for (Iterator i = n.getInit().iterator(); i.hasNext();) { - Expression e = i.next(); - e.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - printer.print("; "); - if (n.getCompare() != null) { - n.getCompare().accept(this, arg); - } - printer.print("; "); - if (n.getUpdate() != null) { - for (Iterator i = n.getUpdate().iterator(); i.hasNext();) { - Expression e = i.next(); - e.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - printer.print(") "); - n.getBody().accept(this, arg); - } - - @Override - public void visit(ThrowStmt n, Object arg) { - printer.print("throw "); - n.getExpr().accept(this, arg); - printer.print(";"); - } - - @Override - public void visit(SynchronizedStmt n, Object arg) { - printer.print("synchronized ("); - n.getExpr().accept(this, arg); - printer.print(") "); - n.getBlock().accept(this, arg); - } - - @Override - public void visit(TryStmt n, Object arg) { - printer.print("try "); - n.getTryBlock().accept(this, arg); - if (n.getCatchs() != null) { - for (CatchClause c : n.getCatchs()) { - c.accept(this, arg); - } - } - if (n.getFinallyBlock() != null) { - printer.print(" finally "); - n.getFinallyBlock().accept(this, arg); - } - } - - @Override - public void visit(CatchClause n, Object arg) { - printer.print(" catch ("); - n.getExcept().accept(this, arg); - printer.print(") "); - n.getCatchBlock().accept(this, arg); - - } - - @Override - public void visit(AnnotationDeclaration n, Object arg) { - printJavadoc(n.getJavaDoc(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - - printer.print("@interface "); - printer.print(n.getName()); - printer.printLn(" {"); - printer.indent(); - if (n.getMembers() != null) { - printMembers(n.getMembers(), arg); - } - printer.unindent(); - printer.print("}"); - } - - @Override - public void visit(AnnotationMemberDeclaration n, Object arg) { - printJavadoc(n.getJavaDoc(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - - n.getType().accept(this, arg); - printer.print(" "); - printer.print(n.getName()); - printer.print("()"); - if (n.getDefaultValue() != null) { - printer.print(" default "); - n.getDefaultValue().accept(this, arg); - } - printer.print(";"); - } - - @Override - public void visit(MarkerAnnotationExpr n, Object arg) { - printer.print("@"); - n.getName().accept(this, arg); - } - - @Override - public void visit(SingleMemberAnnotationExpr n, Object arg) { - printer.print("@"); - n.getName().accept(this, arg); - printer.print("("); - n.getMemberValue().accept(this, arg); - printer.print(")"); - } - - @Override - public void visit(NormalAnnotationExpr n, Object arg) { - printer.print("@"); - n.getName().accept(this, arg); - printer.print("("); - if (n.getPairs() != null) { - for (Iterator i = n.getPairs().iterator(); i.hasNext();) { - MemberValuePair m = i.next(); - m.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - printer.print(")"); - } - - @Override - public void visit(MemberValuePair n, Object arg) { - printer.print(n.getName()); - printer.print(" = "); - n.getValue().accept(this, arg); - } - - @Override - public void visit(LineComment n, Object arg) { - printer.print("//"); - printer.printLn(n.getContent()); - } - - @Override - public void visit(BlockComment n, Object arg) { - printer.print("/*"); - printer.print(n.getContent()); - printer.printLn("*/"); - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/visitor/EqualsVisitor.java b/stubparser/src/org/checkerframework/stubparser/ast/visitor/EqualsVisitor.java deleted file mode 100644 index a752b8dd4ef..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/visitor/EqualsVisitor.java +++ /dev/null @@ -1,1426 +0,0 @@ -/* - * Created on 17/01/2010 - */ -package org.checkerframework.stubparser.ast.visitor; - -import java.util.List; - -import org.checkerframework.stubparser.ast.BlockComment; -import org.checkerframework.stubparser.ast.CompilationUnit; -import org.checkerframework.stubparser.ast.ImportDeclaration; -import org.checkerframework.stubparser.ast.IndexUnit; -import org.checkerframework.stubparser.ast.LineComment; -import org.checkerframework.stubparser.ast.Node; -import org.checkerframework.stubparser.ast.PackageDeclaration; -import org.checkerframework.stubparser.ast.TypeParameter; -import org.checkerframework.stubparser.ast.body.AnnotationDeclaration; -import org.checkerframework.stubparser.ast.body.AnnotationMemberDeclaration; -import org.checkerframework.stubparser.ast.body.ClassOrInterfaceDeclaration; -import org.checkerframework.stubparser.ast.body.ConstructorDeclaration; -import org.checkerframework.stubparser.ast.body.EmptyMemberDeclaration; -import org.checkerframework.stubparser.ast.body.EmptyTypeDeclaration; -import org.checkerframework.stubparser.ast.body.EnumConstantDeclaration; -import org.checkerframework.stubparser.ast.body.EnumDeclaration; -import org.checkerframework.stubparser.ast.body.FieldDeclaration; -import org.checkerframework.stubparser.ast.body.InitializerDeclaration; -import org.checkerframework.stubparser.ast.body.JavadocComment; -import org.checkerframework.stubparser.ast.body.MethodDeclaration; -import org.checkerframework.stubparser.ast.body.Parameter; -import org.checkerframework.stubparser.ast.body.VariableDeclarator; -import org.checkerframework.stubparser.ast.body.VariableDeclaratorId; -import org.checkerframework.stubparser.ast.expr.ArrayAccessExpr; -import org.checkerframework.stubparser.ast.expr.ArrayCreationExpr; -import org.checkerframework.stubparser.ast.expr.ArrayInitializerExpr; -import org.checkerframework.stubparser.ast.expr.AssignExpr; -import org.checkerframework.stubparser.ast.expr.BinaryExpr; -import org.checkerframework.stubparser.ast.expr.BooleanLiteralExpr; -import org.checkerframework.stubparser.ast.expr.CastExpr; -import org.checkerframework.stubparser.ast.expr.CharLiteralExpr; -import org.checkerframework.stubparser.ast.expr.ClassExpr; -import org.checkerframework.stubparser.ast.expr.ConditionalExpr; -import org.checkerframework.stubparser.ast.expr.DoubleLiteralExpr; -import org.checkerframework.stubparser.ast.expr.EnclosedExpr; -import org.checkerframework.stubparser.ast.expr.FieldAccessExpr; -import org.checkerframework.stubparser.ast.expr.InstanceOfExpr; -import org.checkerframework.stubparser.ast.expr.IntegerLiteralExpr; -import org.checkerframework.stubparser.ast.expr.IntegerLiteralMinValueExpr; -import org.checkerframework.stubparser.ast.expr.LongLiteralExpr; -import org.checkerframework.stubparser.ast.expr.LongLiteralMinValueExpr; -import org.checkerframework.stubparser.ast.expr.MarkerAnnotationExpr; -import org.checkerframework.stubparser.ast.expr.MemberValuePair; -import org.checkerframework.stubparser.ast.expr.MethodCallExpr; -import org.checkerframework.stubparser.ast.expr.NameExpr; -import org.checkerframework.stubparser.ast.expr.NormalAnnotationExpr; -import org.checkerframework.stubparser.ast.expr.NullLiteralExpr; -import org.checkerframework.stubparser.ast.expr.ObjectCreationExpr; -import org.checkerframework.stubparser.ast.expr.QualifiedNameExpr; -import org.checkerframework.stubparser.ast.expr.SingleMemberAnnotationExpr; -import org.checkerframework.stubparser.ast.expr.StringLiteralExpr; -import org.checkerframework.stubparser.ast.expr.SuperExpr; -import org.checkerframework.stubparser.ast.expr.ThisExpr; -import org.checkerframework.stubparser.ast.expr.UnaryExpr; -import org.checkerframework.stubparser.ast.expr.VariableDeclarationExpr; -import org.checkerframework.stubparser.ast.stmt.AssertStmt; -import org.checkerframework.stubparser.ast.stmt.BlockStmt; -import org.checkerframework.stubparser.ast.stmt.BreakStmt; -import org.checkerframework.stubparser.ast.stmt.CatchClause; -import org.checkerframework.stubparser.ast.stmt.ContinueStmt; -import org.checkerframework.stubparser.ast.stmt.DoStmt; -import org.checkerframework.stubparser.ast.stmt.EmptyStmt; -import org.checkerframework.stubparser.ast.stmt.ExplicitConstructorInvocationStmt; -import org.checkerframework.stubparser.ast.stmt.ExpressionStmt; -import org.checkerframework.stubparser.ast.stmt.ForStmt; -import org.checkerframework.stubparser.ast.stmt.ForeachStmt; -import org.checkerframework.stubparser.ast.stmt.IfStmt; -import org.checkerframework.stubparser.ast.stmt.LabeledStmt; -import org.checkerframework.stubparser.ast.stmt.ReturnStmt; -import org.checkerframework.stubparser.ast.stmt.SwitchEntryStmt; -import org.checkerframework.stubparser.ast.stmt.SwitchStmt; -import org.checkerframework.stubparser.ast.stmt.SynchronizedStmt; -import org.checkerframework.stubparser.ast.stmt.ThrowStmt; -import org.checkerframework.stubparser.ast.stmt.TryStmt; -import org.checkerframework.stubparser.ast.stmt.TypeDeclarationStmt; -import org.checkerframework.stubparser.ast.stmt.WhileStmt; -import org.checkerframework.stubparser.ast.type.ClassOrInterfaceType; -import org.checkerframework.stubparser.ast.type.PrimitiveType; -import org.checkerframework.stubparser.ast.type.ReferenceType; -import org.checkerframework.stubparser.ast.type.VoidType; -import org.checkerframework.stubparser.ast.type.WildcardType; - -/** - * @author Julio Vilmar Gesser - */ -public class EqualsVisitor implements GenericVisitor { - - private static final EqualsVisitor SINGLETON = new EqualsVisitor(); - - public static boolean equals(Node n1, Node n2) { - return SINGLETON.nodeEquals(n1, n2); - } - - private EqualsVisitor() { - // hide constructor - } - - private boolean nodesEquals(List nodes1, List nodes2) { - if (nodes1 == null) { - if (nodes2 == null) { - return true; - } - return false; - } else if (nodes2 == null) { - return false; - } - if (nodes1.size() != nodes2.size()) { - return false; - } - for (int i = 0; i < nodes1.size(); i++) { - if (!nodeEquals(nodes1.get(i), nodes2.get(i))) { - return false; - } - } - return true; - } - - private boolean nodeEquals(T n1, T n2) { - if (n1 == n2) { - return true; - } - if (n1 == null) { - if (n2 == null) { - return true; - } - return false; - } else if (n2 == null) { - return false; - } - if (n1.getClass() != n2.getClass()) { - return false; - } - return n1.accept(this, n2).booleanValue(); - } - - private boolean objEquals(Object n1, Object n2) { - if (n1 == n2) { - return true; - } - if (n1 == null) { - if (n2 == null) { - return true; - } - return false; - } else if (n2 == null) { - return false; - } - return n1.equals(n2); - } - - @Override - public Boolean visit(CompilationUnit n1, Node arg) { - CompilationUnit n2 = (CompilationUnit) arg; - - if (!nodeEquals(n1.getPackage(), n2.getPackage())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getImports(), n2.getImports())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getTypes(), n2.getTypes())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getComments(), n2.getComments())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(PackageDeclaration n1, Node arg) { - PackageDeclaration n2 = (PackageDeclaration) arg; - - if (!nodeEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(ImportDeclaration n1, Node arg) { - ImportDeclaration n2 = (ImportDeclaration) arg; - - if (!nodeEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(TypeParameter n1, Node arg) { - TypeParameter n2 = (TypeParameter) arg; - - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } - - if (!objEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getTypeBound(), n2.getTypeBound())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(LineComment n1, Node arg) { - LineComment n2 = (LineComment) arg; - - if (!objEquals(n1.getContent(), n2.getContent())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(BlockComment n1, Node arg) { - BlockComment n2 = (BlockComment) arg; - - if (!objEquals(n1.getContent(), n2.getContent())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(ClassOrInterfaceDeclaration n1, Node arg) { - ClassOrInterfaceDeclaration n2 = (ClassOrInterfaceDeclaration) arg; - - // javadoc are checked at CompilationUnit - - if (n1.getModifiers() != n2.getModifiers()) { - return Boolean.FALSE; - } - - if (n1.isInterface() != n2.isInterface()) { - return Boolean.FALSE; - } - - if (!objEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getTypeParameters(), n2.getTypeParameters())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getExtends(), n2.getExtends())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getImplements(), n2.getImplements())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getMembers(), n2.getMembers())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(EnumDeclaration n1, Node arg) { - EnumDeclaration n2 = (EnumDeclaration) arg; - - // javadoc are checked at CompilationUnit - - if (n1.getModifiers() != n2.getModifiers()) { - return Boolean.FALSE; - } - - if (!objEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getImplements(), n2.getImplements())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getEntries(), n2.getEntries())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getMembers(), n2.getMembers())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(EmptyTypeDeclaration n1, Node arg) { - return Boolean.TRUE; - } - - @Override - public Boolean visit(EnumConstantDeclaration n1, Node arg) { - EnumConstantDeclaration n2 = (EnumConstantDeclaration) arg; - - // javadoc are checked at CompilationUnit - - if (!objEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getArgs(), n2.getArgs())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getClassBody(), n2.getClassBody())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(AnnotationDeclaration n1, Node arg) { - AnnotationDeclaration n2 = (AnnotationDeclaration) arg; - - // javadoc are checked at CompilationUnit - - if (n1.getModifiers() != n2.getModifiers()) { - return Boolean.FALSE; - } - - if (!objEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getMembers(), n2.getMembers())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(AnnotationMemberDeclaration n1, Node arg) { - AnnotationMemberDeclaration n2 = (AnnotationMemberDeclaration) arg; - - // javadoc are checked at CompilationUnit - - if (n1.getModifiers() != n2.getModifiers()) { - return Boolean.FALSE; - } - - if (!objEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getDefaultValue(), n2.getDefaultValue())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getType(), n2.getType())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(FieldDeclaration n1, Node arg) { - FieldDeclaration n2 = (FieldDeclaration) arg; - - // javadoc are checked at CompilationUnit - - if (n1.getModifiers() != n2.getModifiers()) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getType(), n2.getType())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getVariables(), n2.getVariables())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(VariableDeclarator n1, Node arg) { - VariableDeclarator n2 = (VariableDeclarator) arg; - - if (!nodeEquals(n1.getId(), n2.getId())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getInit(), n2.getInit())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(VariableDeclaratorId n1, Node arg) { - VariableDeclaratorId n2 = (VariableDeclaratorId) arg; - - if (n1.getArrayCount() != n2.getArrayCount()) { - return Boolean.FALSE; - } - - if (!objEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(ConstructorDeclaration n1, Node arg) { - ConstructorDeclaration n2 = (ConstructorDeclaration) arg; - - // javadoc are checked at CompilationUnit - - if (n1.getModifiers() != n2.getModifiers()) { - return Boolean.FALSE; - } - - if (!objEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getBlock(), n2.getBlock())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getParameters(), n2.getParameters())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getThrows(), n2.getThrows())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getTypeParameters(), n2.getTypeParameters())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(MethodDeclaration n1, Node arg) { - MethodDeclaration n2 = (MethodDeclaration) arg; - - // javadoc are checked at CompilationUnit - - if (n1.getModifiers() != n2.getModifiers()) { - return Boolean.FALSE; - } - - if (n1.getArrayCount() != n2.getArrayCount()) { - return Boolean.FALSE; - } - - if (!objEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getType(), n2.getType())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getBody(), n2.getBody())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getParameters(), n2.getParameters())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getThrows(), n2.getThrows())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getTypeParameters(), n2.getTypeParameters())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(Parameter n1, Node arg) { - Parameter n2 = (Parameter) arg; - - if (n1.getModifiers() != n2.getModifiers()) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getId(), n2.getId())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getType(), n2.getType())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(EmptyMemberDeclaration n1, Node arg) { - return Boolean.TRUE; - } - - @Override - public Boolean visit(InitializerDeclaration n1, Node arg) { - InitializerDeclaration n2 = (InitializerDeclaration) arg; - - if (!nodeEquals(n1.getBlock(), n2.getBlock())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(JavadocComment n1, Node arg) { - JavadocComment n2 = (JavadocComment) arg; - - if (!objEquals(n1.getContent(), n2.getContent())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(ClassOrInterfaceType n1, Node arg) { - ClassOrInterfaceType n2 = (ClassOrInterfaceType) arg; - - if (!objEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getScope(), n2.getScope())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getTypeArgs(), n2.getTypeArgs())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(PrimitiveType n1, Node arg) { - PrimitiveType n2 = (PrimitiveType) arg; - - if (n1.getType() != n2.getType()) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(ReferenceType n1, Node arg) { - ReferenceType n2 = (ReferenceType) arg; - - if (n1.getArrayCount() != n2.getArrayCount()) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getType(), n2.getType())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(VoidType n1, Node arg) { - return Boolean.TRUE; - } - - @Override - public Boolean visit(WildcardType n1, Node arg) { - WildcardType n2 = (WildcardType) arg; - - if (!nodeEquals(n1.getExtends(), n2.getExtends())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getSuper(), n2.getSuper())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(ArrayAccessExpr n1, Node arg) { - ArrayAccessExpr n2 = (ArrayAccessExpr) arg; - - if (!nodeEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getIndex(), n2.getIndex())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(ArrayCreationExpr n1, Node arg) { - ArrayCreationExpr n2 = (ArrayCreationExpr) arg; - - if (n1.getArrayCount() != n2.getArrayCount()) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getType(), n2.getType())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getInitializer(), n2.getInitializer())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getDimensions(), n2.getDimensions())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(ArrayInitializerExpr n1, Node arg) { - ArrayInitializerExpr n2 = (ArrayInitializerExpr) arg; - - if (!nodesEquals(n1.getValues(), n2.getValues())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(AssignExpr n1, Node arg) { - AssignExpr n2 = (AssignExpr) arg; - - if (n1.getOperator() != n2.getOperator()) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getTarget(), n2.getTarget())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getValue(), n2.getValue())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(BinaryExpr n1, Node arg) { - BinaryExpr n2 = (BinaryExpr) arg; - - if (n1.getOperator() != n2.getOperator()) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getLeft(), n2.getLeft())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getRight(), n2.getRight())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(CastExpr n1, Node arg) { - CastExpr n2 = (CastExpr) arg; - - if (!nodeEquals(n1.getType(), n2.getType())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getExpr(), n2.getExpr())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(ClassExpr n1, Node arg) { - ClassExpr n2 = (ClassExpr) arg; - - if (!nodeEquals(n1.getType(), n2.getType())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(ConditionalExpr n1, Node arg) { - ConditionalExpr n2 = (ConditionalExpr) arg; - - if (!nodeEquals(n1.getCondition(), n2.getCondition())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getThenExpr(), n2.getThenExpr())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getElseExpr(), n2.getElseExpr())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(EnclosedExpr n1, Node arg) { - EnclosedExpr n2 = (EnclosedExpr) arg; - - if (!nodeEquals(n1.getInner(), n2.getInner())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(FieldAccessExpr n1, Node arg) { - FieldAccessExpr n2 = (FieldAccessExpr) arg; - - if (!nodeEquals(n1.getScope(), n2.getScope())) { - return Boolean.FALSE; - } - - if (!objEquals(n1.getField(), n2.getField())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getTypeArgs(), n2.getTypeArgs())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(InstanceOfExpr n1, Node arg) { - InstanceOfExpr n2 = (InstanceOfExpr) arg; - - if (!nodeEquals(n1.getExpr(), n2.getExpr())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getType(), n2.getType())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(StringLiteralExpr n1, Node arg) { - StringLiteralExpr n2 = (StringLiteralExpr) arg; - - if (!objEquals(n1.getValue(), n2.getValue())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(IntegerLiteralExpr n1, Node arg) { - IntegerLiteralExpr n2 = (IntegerLiteralExpr) arg; - - if (!objEquals(n1.getValue(), n2.getValue())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(LongLiteralExpr n1, Node arg) { - LongLiteralExpr n2 = (LongLiteralExpr) arg; - - if (!objEquals(n1.getValue(), n2.getValue())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(IntegerLiteralMinValueExpr n1, Node arg) { - IntegerLiteralMinValueExpr n2 = (IntegerLiteralMinValueExpr) arg; - - if (!objEquals(n1.getValue(), n2.getValue())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(LongLiteralMinValueExpr n1, Node arg) { - LongLiteralMinValueExpr n2 = (LongLiteralMinValueExpr) arg; - - if (!objEquals(n1.getValue(), n2.getValue())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(CharLiteralExpr n1, Node arg) { - CharLiteralExpr n2 = (CharLiteralExpr) arg; - - if (!objEquals(n1.getValue(), n2.getValue())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(DoubleLiteralExpr n1, Node arg) { - DoubleLiteralExpr n2 = (DoubleLiteralExpr) arg; - - if (!objEquals(n1.getValue(), n2.getValue())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(BooleanLiteralExpr n1, Node arg) { - BooleanLiteralExpr n2 = (BooleanLiteralExpr) arg; - - if (n1.getValue() != n2.getValue()) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(NullLiteralExpr n1, Node arg) { - return Boolean.TRUE; - } - - @Override - public Boolean visit(MethodCallExpr n1, Node arg) { - MethodCallExpr n2 = (MethodCallExpr) arg; - - if (!nodeEquals(n1.getScope(), n2.getScope())) { - return Boolean.FALSE; - } - - if (!objEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getArgs(), n2.getArgs())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getTypeArgs(), n2.getTypeArgs())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(NameExpr n1, Node arg) { - NameExpr n2 = (NameExpr) arg; - - if (!objEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(ObjectCreationExpr n1, Node arg) { - ObjectCreationExpr n2 = (ObjectCreationExpr) arg; - - if (!nodeEquals(n1.getScope(), n2.getScope())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getType(), n2.getType())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getAnonymousClassBody(), n2.getAnonymousClassBody())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getArgs(), n2.getArgs())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getTypeArgs(), n2.getTypeArgs())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(QualifiedNameExpr n1, Node arg) { - QualifiedNameExpr n2 = (QualifiedNameExpr) arg; - - if (!nodeEquals(n1.getQualifier(), n2.getQualifier())) { - return Boolean.FALSE; - } - - if (!objEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(ThisExpr n1, Node arg) { - ThisExpr n2 = (ThisExpr) arg; - - if (!nodeEquals(n1.getClassExpr(), n2.getClassExpr())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(SuperExpr n1, Node arg) { - SuperExpr n2 = (SuperExpr) arg; - - if (!nodeEquals(n1.getClassExpr(), n2.getClassExpr())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(UnaryExpr n1, Node arg) { - UnaryExpr n2 = (UnaryExpr) arg; - - if (n1.getOperator() != n2.getOperator()) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getExpr(), n2.getExpr())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(VariableDeclarationExpr n1, Node arg) { - VariableDeclarationExpr n2 = (VariableDeclarationExpr) arg; - - if (n1.getModifiers() != n2.getModifiers()) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getType(), n2.getType())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getVars(), n2.getVars())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(MarkerAnnotationExpr n1, Node arg) { - MarkerAnnotationExpr n2 = (MarkerAnnotationExpr) arg; - - if (!nodeEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(SingleMemberAnnotationExpr n1, Node arg) { - SingleMemberAnnotationExpr n2 = (SingleMemberAnnotationExpr) arg; - - if (!nodeEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getMemberValue(), n2.getMemberValue())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(NormalAnnotationExpr n1, Node arg) { - NormalAnnotationExpr n2 = (NormalAnnotationExpr) arg; - - if (!nodeEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getPairs(), n2.getPairs())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(MemberValuePair n1, Node arg) { - MemberValuePair n2 = (MemberValuePair) arg; - - if (!objEquals(n1.getName(), n2.getName())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getValue(), n2.getValue())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(ExplicitConstructorInvocationStmt n1, Node arg) { - ExplicitConstructorInvocationStmt n2 = (ExplicitConstructorInvocationStmt) arg; - - if (!nodeEquals(n1.getExpr(), n2.getExpr())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getArgs(), n2.getArgs())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getTypeArgs(), n2.getTypeArgs())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(TypeDeclarationStmt n1, Node arg) { - TypeDeclarationStmt n2 = (TypeDeclarationStmt) arg; - - if (!nodeEquals(n1.getTypeDeclaration(), n2.getTypeDeclaration())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(AssertStmt n1, Node arg) { - AssertStmt n2 = (AssertStmt) arg; - - if (!nodeEquals(n1.getCheck(), n2.getCheck())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getMessage(), n2.getMessage())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(BlockStmt n1, Node arg) { - BlockStmt n2 = (BlockStmt) arg; - - if (!nodesEquals(n1.getStmts(), n2.getStmts())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(LabeledStmt n1, Node arg) { - LabeledStmt n2 = (LabeledStmt) arg; - - if (!nodeEquals(n1.getStmt(), n2.getStmt())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(EmptyStmt n1, Node arg) { - return Boolean.TRUE; - } - - @Override - public Boolean visit(ExpressionStmt n1, Node arg) { - ExpressionStmt n2 = (ExpressionStmt) arg; - - if (!nodeEquals(n1.getExpression(), n2.getExpression())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(SwitchStmt n1, Node arg) { - SwitchStmt n2 = (SwitchStmt) arg; - - if (!nodeEquals(n1.getSelector(), n2.getSelector())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getEntries(), n2.getEntries())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(SwitchEntryStmt n1, Node arg) { - SwitchEntryStmt n2 = (SwitchEntryStmt) arg; - - if (!nodeEquals(n1.getLabel(), n2.getLabel())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getStmts(), n2.getStmts())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(BreakStmt n1, Node arg) { - BreakStmt n2 = (BreakStmt) arg; - - if (!objEquals(n1.getId(), n2.getId())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(ReturnStmt n1, Node arg) { - ReturnStmt n2 = (ReturnStmt) arg; - - if (!nodeEquals(n1.getExpr(), n2.getExpr())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(IfStmt n1, Node arg) { - IfStmt n2 = (IfStmt) arg; - - if (!nodeEquals(n1.getCondition(), n2.getCondition())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getThenStmt(), n2.getThenStmt())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getElseStmt(), n2.getElseStmt())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(WhileStmt n1, Node arg) { - WhileStmt n2 = (WhileStmt) arg; - - if (!nodeEquals(n1.getCondition(), n2.getCondition())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getBody(), n2.getBody())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(ContinueStmt n1, Node arg) { - ContinueStmt n2 = (ContinueStmt) arg; - - if (!objEquals(n1.getId(), n2.getId())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(DoStmt n1, Node arg) { - DoStmt n2 = (DoStmt) arg; - - if (!nodeEquals(n1.getBody(), n2.getBody())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getCondition(), n2.getCondition())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(ForeachStmt n1, Node arg) { - ForeachStmt n2 = (ForeachStmt) arg; - - if (!nodeEquals(n1.getVariable(), n2.getVariable())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getIterable(), n2.getIterable())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getBody(), n2.getBody())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(ForStmt n1, Node arg) { - ForStmt n2 = (ForStmt) arg; - - if (!nodesEquals(n1.getInit(), n2.getInit())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getCompare(), n2.getCompare())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getUpdate(), n2.getUpdate())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getBody(), n2.getBody())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(ThrowStmt n1, Node arg) { - ThrowStmt n2 = (ThrowStmt) arg; - - if (!nodeEquals(n1.getExpr(), n2.getExpr())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(SynchronizedStmt n1, Node arg) { - SynchronizedStmt n2 = (SynchronizedStmt) arg; - - if (!nodeEquals(n1.getExpr(), n2.getExpr())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getBlock(), n2.getBlock())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(TryStmt n1, Node arg) { - TryStmt n2 = (TryStmt) arg; - - if (!nodeEquals(n1.getTryBlock(), n2.getTryBlock())) { - return Boolean.FALSE; - } - - if (!nodesEquals(n1.getCatchs(), n2.getCatchs())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getFinallyBlock(), n2.getFinallyBlock())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(CatchClause n1, Node arg) { - CatchClause n2 = (CatchClause) arg; - - if (!nodeEquals(n1.getExcept(), n2.getExcept())) { - return Boolean.FALSE; - } - - if (!nodeEquals(n1.getCatchBlock(), n2.getCatchBlock())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - @Override - public Boolean visit(IndexUnit n, Node arg) { - throw new RuntimeException("Not Supported!"); - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/visitor/GenericVisitor.java b/stubparser/src/org/checkerframework/stubparser/ast/visitor/GenericVisitor.java deleted file mode 100644 index 50bee32f0b6..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/visitor/GenericVisitor.java +++ /dev/null @@ -1,280 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.visitor; - -import org.checkerframework.stubparser.ast.BlockComment; -import org.checkerframework.stubparser.ast.CompilationUnit; -import org.checkerframework.stubparser.ast.ImportDeclaration; -import org.checkerframework.stubparser.ast.IndexUnit; -import org.checkerframework.stubparser.ast.LineComment; -import org.checkerframework.stubparser.ast.PackageDeclaration; -import org.checkerframework.stubparser.ast.TypeParameter; -import org.checkerframework.stubparser.ast.body.AnnotationDeclaration; -import org.checkerframework.stubparser.ast.body.AnnotationMemberDeclaration; -import org.checkerframework.stubparser.ast.body.ClassOrInterfaceDeclaration; -import org.checkerframework.stubparser.ast.body.ConstructorDeclaration; -import org.checkerframework.stubparser.ast.body.EmptyMemberDeclaration; -import org.checkerframework.stubparser.ast.body.EmptyTypeDeclaration; -import org.checkerframework.stubparser.ast.body.EnumConstantDeclaration; -import org.checkerframework.stubparser.ast.body.EnumDeclaration; -import org.checkerframework.stubparser.ast.body.FieldDeclaration; -import org.checkerframework.stubparser.ast.body.InitializerDeclaration; -import org.checkerframework.stubparser.ast.body.JavadocComment; -import org.checkerframework.stubparser.ast.body.MethodDeclaration; -import org.checkerframework.stubparser.ast.body.Parameter; -import org.checkerframework.stubparser.ast.body.VariableDeclarator; -import org.checkerframework.stubparser.ast.body.VariableDeclaratorId; -import org.checkerframework.stubparser.ast.expr.ArrayAccessExpr; -import org.checkerframework.stubparser.ast.expr.ArrayCreationExpr; -import org.checkerframework.stubparser.ast.expr.ArrayInitializerExpr; -import org.checkerframework.stubparser.ast.expr.AssignExpr; -import org.checkerframework.stubparser.ast.expr.BinaryExpr; -import org.checkerframework.stubparser.ast.expr.BooleanLiteralExpr; -import org.checkerframework.stubparser.ast.expr.CastExpr; -import org.checkerframework.stubparser.ast.expr.CharLiteralExpr; -import org.checkerframework.stubparser.ast.expr.ClassExpr; -import org.checkerframework.stubparser.ast.expr.ConditionalExpr; -import org.checkerframework.stubparser.ast.expr.DoubleLiteralExpr; -import org.checkerframework.stubparser.ast.expr.EnclosedExpr; -import org.checkerframework.stubparser.ast.expr.FieldAccessExpr; -import org.checkerframework.stubparser.ast.expr.InstanceOfExpr; -import org.checkerframework.stubparser.ast.expr.IntegerLiteralExpr; -import org.checkerframework.stubparser.ast.expr.IntegerLiteralMinValueExpr; -import org.checkerframework.stubparser.ast.expr.LongLiteralExpr; -import org.checkerframework.stubparser.ast.expr.LongLiteralMinValueExpr; -import org.checkerframework.stubparser.ast.expr.MarkerAnnotationExpr; -import org.checkerframework.stubparser.ast.expr.MemberValuePair; -import org.checkerframework.stubparser.ast.expr.MethodCallExpr; -import org.checkerframework.stubparser.ast.expr.NameExpr; -import org.checkerframework.stubparser.ast.expr.NormalAnnotationExpr; -import org.checkerframework.stubparser.ast.expr.NullLiteralExpr; -import org.checkerframework.stubparser.ast.expr.ObjectCreationExpr; -import org.checkerframework.stubparser.ast.expr.QualifiedNameExpr; -import org.checkerframework.stubparser.ast.expr.SingleMemberAnnotationExpr; -import org.checkerframework.stubparser.ast.expr.StringLiteralExpr; -import org.checkerframework.stubparser.ast.expr.SuperExpr; -import org.checkerframework.stubparser.ast.expr.ThisExpr; -import org.checkerframework.stubparser.ast.expr.UnaryExpr; -import org.checkerframework.stubparser.ast.expr.VariableDeclarationExpr; -import org.checkerframework.stubparser.ast.stmt.AssertStmt; -import org.checkerframework.stubparser.ast.stmt.BlockStmt; -import org.checkerframework.stubparser.ast.stmt.BreakStmt; -import org.checkerframework.stubparser.ast.stmt.CatchClause; -import org.checkerframework.stubparser.ast.stmt.ContinueStmt; -import org.checkerframework.stubparser.ast.stmt.DoStmt; -import org.checkerframework.stubparser.ast.stmt.EmptyStmt; -import org.checkerframework.stubparser.ast.stmt.ExplicitConstructorInvocationStmt; -import org.checkerframework.stubparser.ast.stmt.ExpressionStmt; -import org.checkerframework.stubparser.ast.stmt.ForStmt; -import org.checkerframework.stubparser.ast.stmt.ForeachStmt; -import org.checkerframework.stubparser.ast.stmt.IfStmt; -import org.checkerframework.stubparser.ast.stmt.LabeledStmt; -import org.checkerframework.stubparser.ast.stmt.ReturnStmt; -import org.checkerframework.stubparser.ast.stmt.SwitchEntryStmt; -import org.checkerframework.stubparser.ast.stmt.SwitchStmt; -import org.checkerframework.stubparser.ast.stmt.SynchronizedStmt; -import org.checkerframework.stubparser.ast.stmt.ThrowStmt; -import org.checkerframework.stubparser.ast.stmt.TryStmt; -import org.checkerframework.stubparser.ast.stmt.TypeDeclarationStmt; -import org.checkerframework.stubparser.ast.stmt.WhileStmt; -import org.checkerframework.stubparser.ast.type.ClassOrInterfaceType; -import org.checkerframework.stubparser.ast.type.PrimitiveType; -import org.checkerframework.stubparser.ast.type.ReferenceType; -import org.checkerframework.stubparser.ast.type.VoidType; -import org.checkerframework.stubparser.ast.type.WildcardType; - -/** - * @author Julio Vilmar Gesser - */ -public interface GenericVisitor { - - //- Compilation Unit ---------------------------------- - - public R visit(IndexUnit n, A arg); - - public R visit(CompilationUnit n, A arg); - - public R visit(PackageDeclaration n, A arg); - - public R visit(ImportDeclaration n, A arg); - - public R visit(TypeParameter n, A arg); - - public R visit(LineComment n, A arg); - - public R visit(BlockComment n, A arg); - - //- Body ---------------------------------------------- - - public R visit(ClassOrInterfaceDeclaration n, A arg); - - public R visit(EnumDeclaration n, A arg); - - public R visit(EmptyTypeDeclaration n, A arg); - - public R visit(EnumConstantDeclaration n, A arg); - - public R visit(AnnotationDeclaration n, A arg); - - public R visit(AnnotationMemberDeclaration n, A arg); - - public R visit(FieldDeclaration n, A arg); - - public R visit(VariableDeclarator n, A arg); - - public R visit(VariableDeclaratorId n, A arg); - - public R visit(ConstructorDeclaration n, A arg); - - public R visit(MethodDeclaration n, A arg); - - public R visit(Parameter n, A arg); - - public R visit(EmptyMemberDeclaration n, A arg); - - public R visit(InitializerDeclaration n, A arg); - - public R visit(JavadocComment n, A arg); - - //- Type ---------------------------------------------- - - public R visit(ClassOrInterfaceType n, A arg); - - public R visit(PrimitiveType n, A arg); - - public R visit(ReferenceType n, A arg); - - public R visit(VoidType n, A arg); - - public R visit(WildcardType n, A arg); - - //- Expression ---------------------------------------- - - public R visit(ArrayAccessExpr n, A arg); - - public R visit(ArrayCreationExpr n, A arg); - - public R visit(ArrayInitializerExpr n, A arg); - - public R visit(AssignExpr n, A arg); - - public R visit(BinaryExpr n, A arg); - - public R visit(CastExpr n, A arg); - - public R visit(ClassExpr n, A arg); - - public R visit(ConditionalExpr n, A arg); - - public R visit(EnclosedExpr n, A arg); - - public R visit(FieldAccessExpr n, A arg); - - public R visit(InstanceOfExpr n, A arg); - - public R visit(StringLiteralExpr n, A arg); - - public R visit(IntegerLiteralExpr n, A arg); - - public R visit(LongLiteralExpr n, A arg); - - public R visit(IntegerLiteralMinValueExpr n, A arg); - - public R visit(LongLiteralMinValueExpr n, A arg); - - public R visit(CharLiteralExpr n, A arg); - - public R visit(DoubleLiteralExpr n, A arg); - - public R visit(BooleanLiteralExpr n, A arg); - - public R visit(NullLiteralExpr n, A arg); - - public R visit(MethodCallExpr n, A arg); - - public R visit(NameExpr n, A arg); - - public R visit(ObjectCreationExpr n, A arg); - - public R visit(QualifiedNameExpr n, A arg); - - public R visit(ThisExpr n, A arg); - - public R visit(SuperExpr n, A arg); - - public R visit(UnaryExpr n, A arg); - - public R visit(VariableDeclarationExpr n, A arg); - - public R visit(MarkerAnnotationExpr n, A arg); - - public R visit(SingleMemberAnnotationExpr n, A arg); - - public R visit(NormalAnnotationExpr n, A arg); - - public R visit(MemberValuePair n, A arg); - - //- Statements ---------------------------------------- - - public R visit(ExplicitConstructorInvocationStmt n, A arg); - - public R visit(TypeDeclarationStmt n, A arg); - - public R visit(AssertStmt n, A arg); - - public R visit(BlockStmt n, A arg); - - public R visit(LabeledStmt n, A arg); - - public R visit(EmptyStmt n, A arg); - - public R visit(ExpressionStmt n, A arg); - - public R visit(SwitchStmt n, A arg); - - public R visit(SwitchEntryStmt n, A arg); - - public R visit(BreakStmt n, A arg); - - public R visit(ReturnStmt n, A arg); - - public R visit(IfStmt n, A arg); - - public R visit(WhileStmt n, A arg); - - public R visit(ContinueStmt n, A arg); - - public R visit(DoStmt n, A arg); - - public R visit(ForeachStmt n, A arg); - - public R visit(ForStmt n, A arg); - - public R visit(ThrowStmt n, A arg); - - public R visit(SynchronizedStmt n, A arg); - - public R visit(TryStmt n, A arg); - - public R visit(CatchClause n, A arg); - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/visitor/GenericVisitorAdapter.java b/stubparser/src/org/checkerframework/stubparser/ast/visitor/GenericVisitorAdapter.java deleted file mode 100644 index 27c88fa6ec7..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/visitor/GenericVisitorAdapter.java +++ /dev/null @@ -1,918 +0,0 @@ -/* - * Copyright (C) 2008 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 09/06/2008 - */ -package org.checkerframework.stubparser.ast.visitor; - -import org.checkerframework.stubparser.ast.BlockComment; -import org.checkerframework.stubparser.ast.CompilationUnit; -import org.checkerframework.stubparser.ast.ImportDeclaration; -import org.checkerframework.stubparser.ast.IndexUnit; -import org.checkerframework.stubparser.ast.LineComment; -import org.checkerframework.stubparser.ast.PackageDeclaration; -import org.checkerframework.stubparser.ast.TypeParameter; -import org.checkerframework.stubparser.ast.body.AnnotationDeclaration; -import org.checkerframework.stubparser.ast.body.AnnotationMemberDeclaration; -import org.checkerframework.stubparser.ast.body.BodyDeclaration; -import org.checkerframework.stubparser.ast.body.ClassOrInterfaceDeclaration; -import org.checkerframework.stubparser.ast.body.ConstructorDeclaration; -import org.checkerframework.stubparser.ast.body.EmptyMemberDeclaration; -import org.checkerframework.stubparser.ast.body.EmptyTypeDeclaration; -import org.checkerframework.stubparser.ast.body.EnumConstantDeclaration; -import org.checkerframework.stubparser.ast.body.EnumDeclaration; -import org.checkerframework.stubparser.ast.body.FieldDeclaration; -import org.checkerframework.stubparser.ast.body.InitializerDeclaration; -import org.checkerframework.stubparser.ast.body.JavadocComment; -import org.checkerframework.stubparser.ast.body.MethodDeclaration; -import org.checkerframework.stubparser.ast.body.Parameter; -import org.checkerframework.stubparser.ast.body.TypeDeclaration; -import org.checkerframework.stubparser.ast.body.VariableDeclarator; -import org.checkerframework.stubparser.ast.body.VariableDeclaratorId; -import org.checkerframework.stubparser.ast.expr.AnnotationExpr; -import org.checkerframework.stubparser.ast.expr.ArrayAccessExpr; -import org.checkerframework.stubparser.ast.expr.ArrayCreationExpr; -import org.checkerframework.stubparser.ast.expr.ArrayInitializerExpr; -import org.checkerframework.stubparser.ast.expr.AssignExpr; -import org.checkerframework.stubparser.ast.expr.BinaryExpr; -import org.checkerframework.stubparser.ast.expr.BooleanLiteralExpr; -import org.checkerframework.stubparser.ast.expr.CastExpr; -import org.checkerframework.stubparser.ast.expr.CharLiteralExpr; -import org.checkerframework.stubparser.ast.expr.ClassExpr; -import org.checkerframework.stubparser.ast.expr.ConditionalExpr; -import org.checkerframework.stubparser.ast.expr.DoubleLiteralExpr; -import org.checkerframework.stubparser.ast.expr.EnclosedExpr; -import org.checkerframework.stubparser.ast.expr.Expression; -import org.checkerframework.stubparser.ast.expr.FieldAccessExpr; -import org.checkerframework.stubparser.ast.expr.InstanceOfExpr; -import org.checkerframework.stubparser.ast.expr.IntegerLiteralExpr; -import org.checkerframework.stubparser.ast.expr.IntegerLiteralMinValueExpr; -import org.checkerframework.stubparser.ast.expr.LongLiteralExpr; -import org.checkerframework.stubparser.ast.expr.LongLiteralMinValueExpr; -import org.checkerframework.stubparser.ast.expr.MarkerAnnotationExpr; -import org.checkerframework.stubparser.ast.expr.MemberValuePair; -import org.checkerframework.stubparser.ast.expr.MethodCallExpr; -import org.checkerframework.stubparser.ast.expr.NameExpr; -import org.checkerframework.stubparser.ast.expr.NormalAnnotationExpr; -import org.checkerframework.stubparser.ast.expr.NullLiteralExpr; -import org.checkerframework.stubparser.ast.expr.ObjectCreationExpr; -import org.checkerframework.stubparser.ast.expr.QualifiedNameExpr; -import org.checkerframework.stubparser.ast.expr.SingleMemberAnnotationExpr; -import org.checkerframework.stubparser.ast.expr.StringLiteralExpr; -import org.checkerframework.stubparser.ast.expr.SuperExpr; -import org.checkerframework.stubparser.ast.expr.ThisExpr; -import org.checkerframework.stubparser.ast.expr.UnaryExpr; -import org.checkerframework.stubparser.ast.expr.VariableDeclarationExpr; -import org.checkerframework.stubparser.ast.stmt.AssertStmt; -import org.checkerframework.stubparser.ast.stmt.BlockStmt; -import org.checkerframework.stubparser.ast.stmt.BreakStmt; -import org.checkerframework.stubparser.ast.stmt.CatchClause; -import org.checkerframework.stubparser.ast.stmt.ContinueStmt; -import org.checkerframework.stubparser.ast.stmt.DoStmt; -import org.checkerframework.stubparser.ast.stmt.EmptyStmt; -import org.checkerframework.stubparser.ast.stmt.ExplicitConstructorInvocationStmt; -import org.checkerframework.stubparser.ast.stmt.ExpressionStmt; -import org.checkerframework.stubparser.ast.stmt.ForStmt; -import org.checkerframework.stubparser.ast.stmt.ForeachStmt; -import org.checkerframework.stubparser.ast.stmt.IfStmt; -import org.checkerframework.stubparser.ast.stmt.LabeledStmt; -import org.checkerframework.stubparser.ast.stmt.ReturnStmt; -import org.checkerframework.stubparser.ast.stmt.Statement; -import org.checkerframework.stubparser.ast.stmt.SwitchEntryStmt; -import org.checkerframework.stubparser.ast.stmt.SwitchStmt; -import org.checkerframework.stubparser.ast.stmt.SynchronizedStmt; -import org.checkerframework.stubparser.ast.stmt.ThrowStmt; -import org.checkerframework.stubparser.ast.stmt.TryStmt; -import org.checkerframework.stubparser.ast.stmt.TypeDeclarationStmt; -import org.checkerframework.stubparser.ast.stmt.WhileStmt; -import org.checkerframework.stubparser.ast.type.ClassOrInterfaceType; -import org.checkerframework.stubparser.ast.type.PrimitiveType; -import org.checkerframework.stubparser.ast.type.ReferenceType; -import org.checkerframework.stubparser.ast.type.Type; -import org.checkerframework.stubparser.ast.type.VoidType; -import org.checkerframework.stubparser.ast.type.WildcardType; - -/** - * @author Julio Vilmar Gesser - */ -public abstract class GenericVisitorAdapter implements GenericVisitor { - - @Override - public R visit(AnnotationDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getMembers() != null) { - for (BodyDeclaration member : n.getMembers()) { - member.accept(this, arg); - } - } - return null; - } - - @Override - public R visit(AnnotationMemberDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - n.getType().accept(this, arg); - if (n.getDefaultValue() != null) { - n.getDefaultValue().accept(this, arg); - } - return null; - } - - @Override - public R visit(ArrayAccessExpr n, A arg) { - n.getName().accept(this, arg); - n.getIndex().accept(this, arg); - return null; - } - - @Override - public R visit(ArrayCreationExpr n, A arg) { - n.getType().accept(this, arg); - if (n.getDimensions() != null) { - for (Expression dim : n.getDimensions()) { - dim.accept(this, arg); - } - } else { - n.getInitializer().accept(this, arg); - } - return null; - } - - @Override - public R visit(ArrayInitializerExpr n, A arg) { - if (n.getValues() != null) { - for (Expression expr : n.getValues()) { - expr.accept(this, arg); - } - } - return null; - } - - @Override - public R visit(AssertStmt n, A arg) { - n.getCheck().accept(this, arg); - if (n.getMessage() != null) { - n.getMessage().accept(this, arg); - } - return null; - } - - @Override - public R visit(AssignExpr n, A arg) { - n.getTarget().accept(this, arg); - n.getValue().accept(this, arg); - return null; - } - - @Override - public R visit(BinaryExpr n, A arg) { - n.getLeft().accept(this, arg); - n.getRight().accept(this, arg); - return null; - } - - @Override - public R visit(BlockStmt n, A arg) { - if (n.getStmts() != null) { - for (Statement s : n.getStmts()) { - s.accept(this, arg); - } - } - return null; - - } - - @Override - public R visit(BooleanLiteralExpr n, A arg) { - return null; - } - - @Override - public R visit(BreakStmt n, A arg) { - return null; - } - - @Override - public R visit(CastExpr n, A arg) { - n.getType().accept(this, arg); - n.getExpr().accept(this, arg); - return null; - } - - @Override - public R visit(CatchClause n, A arg) { - n.getExcept().accept(this, arg); - n.getCatchBlock().accept(this, arg); - return null; - - } - - @Override - public R visit(CharLiteralExpr n, A arg) { - return null; - } - - @Override - public R visit(ClassExpr n, A arg) { - n.getType().accept(this, arg); - return null; - } - - @Override - public R visit(ClassOrInterfaceDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getTypeParameters() != null) { - for (TypeParameter t : n.getTypeParameters()) { - t.accept(this, arg); - } - } - if (n.getExtends() != null) { - for (ClassOrInterfaceType c : n.getExtends()) { - c.accept(this, arg); - } - } - - if (n.getImplements() != null) { - for (ClassOrInterfaceType c : n.getImplements()) { - c.accept(this, arg); - } - } - if (n.getMembers() != null) { - for (BodyDeclaration member : n.getMembers()) { - member.accept(this, arg); - } - } - return null; - } - - @Override - public R visit(ClassOrInterfaceType n, A arg) { - if (n.getScope() != null) { - n.getScope().accept(this, arg); - } - if (n.getTypeArgs() != null) { - for (Type t : n.getTypeArgs()) { - t.accept(this, arg); - } - } - return null; - } - - @Override - public R visit(CompilationUnit n, A arg) { - if (n.getPackage() != null) { - n.getPackage().accept(this, arg); - } - if (n.getImports() != null) { - for (ImportDeclaration i : n.getImports()) { - i.accept(this, arg); - } - } - if (n.getTypes() != null) { - for (TypeDeclaration typeDeclaration : n.getTypes()) { - typeDeclaration.accept(this, arg); - } - } - return null; - } - - @Override - public R visit(ConditionalExpr n, A arg) { - n.getCondition().accept(this, arg); - n.getThenExpr().accept(this, arg); - n.getElseExpr().accept(this, arg); - return null; - } - - @Override - public R visit(ConstructorDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getTypeParameters() != null) { - for (TypeParameter t : n.getTypeParameters()) { - t.accept(this, arg); - } - } - if (n.getParameters() != null) { - for (Parameter p : n.getParameters()) { - p.accept(this, arg); - } - } - if (n.getThrows() != null) { - for (NameExpr name : n.getThrows()) { - name.accept(this, arg); - } - } - n.getBlock().accept(this, arg); - return null; - } - - @Override - public R visit(ContinueStmt n, A arg) { - return null; - } - - @Override - public R visit(DoStmt n, A arg) { - n.getBody().accept(this, arg); - n.getCondition().accept(this, arg); - return null; - } - - @Override - public R visit(DoubleLiteralExpr n, A arg) { - return null; - } - - @Override - public R visit(EmptyMemberDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - return null; - } - - @Override - public R visit(EmptyStmt n, A arg) { - return null; - } - - @Override - public R visit(EmptyTypeDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - return null; - } - - @Override - public R visit(EnclosedExpr n, A arg) { - n.getInner().accept(this, arg); - return null; - } - - @Override - public R visit(EnumConstantDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getArgs() != null) { - for (Expression e : n.getArgs()) { - e.accept(this, arg); - } - } - if (n.getClassBody() != null) { - for (BodyDeclaration member : n.getClassBody()) { - member.accept(this, arg); - } - } - return null; - } - - @Override - public R visit(EnumDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getImplements() != null) { - for (ClassOrInterfaceType c : n.getImplements()) { - c.accept(this, arg); - } - } - if (n.getEntries() != null) { - for (EnumConstantDeclaration e : n.getEntries()) { - e.accept(this, arg); - } - } - if (n.getMembers() != null) { - for (BodyDeclaration member : n.getMembers()) { - member.accept(this, arg); - } - } - return null; - } - - @Override - public R visit(ExplicitConstructorInvocationStmt n, A arg) { - if (!n.isThis()) { - if (n.getExpr() != null) { - n.getExpr().accept(this, arg); - } - } - if (n.getTypeArgs() != null) { - for (Type t : n.getTypeArgs()) { - t.accept(this, arg); - } - } - if (n.getArgs() != null) { - for (Expression e : n.getArgs()) { - e.accept(this, arg); - } - } - return null; - } - - @Override - public R visit(ExpressionStmt n, A arg) { - n.getExpression().accept(this, arg); - return null; - } - - @Override - public R visit(FieldAccessExpr n, A arg) { - n.getScope().accept(this, arg); - return null; - } - - @Override - public R visit(FieldDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - n.getType().accept(this, arg); - for (VariableDeclarator var : n.getVariables()) { - var.accept(this, arg); - } - return null; - } - - @Override - public R visit(ForeachStmt n, A arg) { - n.getVariable().accept(this, arg); - n.getIterable().accept(this, arg); - n.getBody().accept(this, arg); - return null; - } - - @Override - public R visit(ForStmt n, A arg) { - if (n.getInit() != null) { - for (Expression e : n.getInit()) { - e.accept(this, arg); - } - } - if (n.getCompare() != null) { - n.getCompare().accept(this, arg); - } - if (n.getUpdate() != null) { - for (Expression e : n.getUpdate()) { - e.accept(this, arg); - } - } - n.getBody().accept(this, arg); - return null; - } - - @Override - public R visit(IfStmt n, A arg) { - n.getCondition().accept(this, arg); - n.getThenStmt().accept(this, arg); - if (n.getElseStmt() != null) { - n.getElseStmt().accept(this, arg); - } - return null; - } - - @Override - public R visit(ImportDeclaration n, A arg) { - n.getName().accept(this, arg); - return null; - } - - @Override - public R visit(InitializerDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - n.getBlock().accept(this, arg); - return null; - } - - @Override - public R visit(InstanceOfExpr n, A arg) { - n.getExpr().accept(this, arg); - n.getType().accept(this, arg); - return null; - } - - @Override - public R visit(IntegerLiteralExpr n, A arg) { - return null; - } - - @Override - public R visit(IntegerLiteralMinValueExpr n, A arg) { - return null; - } - - @Override - public R visit(JavadocComment n, A arg) { - return null; - } - - @Override - public R visit(LabeledStmt n, A arg) { - n.getStmt().accept(this, arg); - return null; - } - - @Override - public R visit(LongLiteralExpr n, A arg) { - return null; - } - - @Override - public R visit(LongLiteralMinValueExpr n, A arg) { - return null; - } - - @Override - public R visit(MarkerAnnotationExpr n, A arg) { - n.getName().accept(this, arg); - return null; - } - - @Override - public R visit(MemberValuePair n, A arg) { - n.getValue().accept(this, arg); - return null; - } - - @Override - public R visit(MethodCallExpr n, A arg) { - if (n.getScope() != null) { - n.getScope().accept(this, arg); - } - if (n.getTypeArgs() != null) { - for (Type t : n.getTypeArgs()) { - t.accept(this, arg); - } - } - if (n.getArgs() != null) { - for (Expression e : n.getArgs()) { - e.accept(this, arg); - } - } - return null; - } - - @Override - public R visit(MethodDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getTypeParameters() != null) { - for (TypeParameter t : n.getTypeParameters()) { - t.accept(this, arg); - } - } - n.getType().accept(this, arg); - if (n.getParameters() != null) { - for (Parameter p : n.getParameters()) { - p.accept(this, arg); - } - } - if (n.getThrows() != null) { - for (NameExpr name : n.getThrows()) { - name.accept(this, arg); - } - } - if (n.getBody() != null) { - n.getBody().accept(this, arg); - } - return null; - } - - @Override - public R visit(NameExpr n, A arg) { - return null; - } - - @Override - public R visit(NormalAnnotationExpr n, A arg) { - n.getName().accept(this, arg); - if (n.getPairs() != null) { - for (MemberValuePair m : n.getPairs()) { - m.accept(this, arg); - } - } - return null; - } - - @Override - public R visit(NullLiteralExpr n, A arg) { - return null; - } - - @Override - public R visit(ObjectCreationExpr n, A arg) { - if (n.getScope() != null) { - n.getScope().accept(this, arg); - } - if (n.getTypeArgs() != null) { - for (Type t : n.getTypeArgs()) { - t.accept(this, arg); - } - } - n.getType().accept(this, arg); - if (n.getArgs() != null) { - for (Expression e : n.getArgs()) { - e.accept(this, arg); - } - } - if (n.getAnonymousClassBody() != null) { - for (BodyDeclaration member : n.getAnonymousClassBody()) { - member.accept(this, arg); - } - } - return null; - } - - @Override - public R visit(PackageDeclaration n, A arg) { - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - n.getName().accept(this, arg); - return null; - } - - @Override - public R visit(Parameter n, A arg) { - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - n.getType().accept(this, arg); - n.getId().accept(this, arg); - return null; - } - - @Override - public R visit(PrimitiveType n, A arg) { - return null; - } - - @Override - public R visit(QualifiedNameExpr n, A arg) { - n.getQualifier().accept(this, arg); - return null; - } - - @Override - public R visit(ReferenceType n, A arg) { - n.getType().accept(this, arg); - return null; - } - - @Override - public R visit(ReturnStmt n, A arg) { - if (n.getExpr() != null) { - n.getExpr().accept(this, arg); - } - return null; - } - - @Override - public R visit(SingleMemberAnnotationExpr n, A arg) { - n.getName().accept(this, arg); - n.getMemberValue().accept(this, arg); - return null; - } - - @Override - public R visit(StringLiteralExpr n, A arg) { - return null; - } - - @Override - public R visit(SuperExpr n, A arg) { - if (n.getClassExpr() != null) { - n.getClassExpr().accept(this, arg); - } - return null; - } - - @Override - public R visit(SwitchEntryStmt n, A arg) { - if (n.getLabel() != null) { - n.getLabel().accept(this, arg); - } - if (n.getStmts() != null) { - for (Statement s : n.getStmts()) { - s.accept(this, arg); - } - } - return null; - } - - @Override - public R visit(SwitchStmt n, A arg) { - n.getSelector().accept(this, arg); - if (n.getEntries() != null) { - for (SwitchEntryStmt e : n.getEntries()) { - e.accept(this, arg); - } - } - return null; - - } - - @Override - public R visit(SynchronizedStmt n, A arg) { - n.getExpr().accept(this, arg); - n.getBlock().accept(this, arg); - return null; - } - - @Override - public R visit(ThisExpr n, A arg) { - if (n.getClassExpr() != null) { - n.getClassExpr().accept(this, arg); - } - return null; - } - - @Override - public R visit(ThrowStmt n, A arg) { - n.getExpr().accept(this, arg); - return null; - } - - @Override - public R visit(TryStmt n, A arg) { - n.getTryBlock().accept(this, arg); - if (n.getCatchs() != null) { - for (CatchClause c : n.getCatchs()) { - c.accept(this, arg); - } - } - if (n.getFinallyBlock() != null) { - n.getFinallyBlock().accept(this, arg); - } - return null; - } - - @Override - public R visit(TypeDeclarationStmt n, A arg) { - n.getTypeDeclaration().accept(this, arg); - return null; - } - - @Override - public R visit(TypeParameter n, A arg) { - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getTypeBound() != null) { - for (ClassOrInterfaceType c : n.getTypeBound()) { - c.accept(this, arg); - } - } - return null; - } - - @Override - public R visit(UnaryExpr n, A arg) { - n.getExpr().accept(this, arg); - return null; - } - - @Override - public R visit(VariableDeclarationExpr n, A arg) { - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - n.getType().accept(this, arg); - for (VariableDeclarator v : n.getVars()) { - v.accept(this, arg); - } - return null; - } - - @Override - public R visit(VariableDeclarator n, A arg) { - n.getId().accept(this, arg); - if (n.getInit() != null) { - n.getInit().accept(this, arg); - } - return null; - } - - @Override - public R visit(VariableDeclaratorId n, A arg) { - return null; - } - - @Override - public R visit(VoidType n, A arg) { - return null; - } - - @Override - public R visit(WhileStmt n, A arg) { - n.getCondition().accept(this, arg); - n.getBody().accept(this, arg); - return null; - } - - @Override - public R visit(WildcardType n, A arg) { - if (n.getExtends() != null) { - n.getExtends().accept(this, arg); - } - if (n.getSuper() != null) { - n.getSuper().accept(this, arg); - } - return null; - } - - @Override - public R visit(IndexUnit n, A arg) { - for (CompilationUnit unit : n.getCompilationUnits()) { - unit.accept(this, arg); - } - return null; - } - - @Override - public R visit(BlockComment n, A arg) { - return null; - } - - @Override - public R visit(LineComment n, A arg) { - return null; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/visitor/ModifierVisitorAdapter.java b/stubparser/src/org/checkerframework/stubparser/ast/visitor/ModifierVisitorAdapter.java deleted file mode 100644 index bf98684b8ff..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/visitor/ModifierVisitorAdapter.java +++ /dev/null @@ -1,1026 +0,0 @@ -/* - * Copyright (C) 2008 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 09/06/2008 - */ -package org.checkerframework.stubparser.ast.visitor; - -import java.util.List; - -import org.checkerframework.stubparser.ast.BlockComment; -import org.checkerframework.stubparser.ast.CompilationUnit; -import org.checkerframework.stubparser.ast.ImportDeclaration; -import org.checkerframework.stubparser.ast.LineComment; -import org.checkerframework.stubparser.ast.Node; -import org.checkerframework.stubparser.ast.PackageDeclaration; -import org.checkerframework.stubparser.ast.TypeParameter; -import org.checkerframework.stubparser.ast.body.AnnotationDeclaration; -import org.checkerframework.stubparser.ast.body.AnnotationMemberDeclaration; -import org.checkerframework.stubparser.ast.body.BodyDeclaration; -import org.checkerframework.stubparser.ast.body.ClassOrInterfaceDeclaration; -import org.checkerframework.stubparser.ast.body.ConstructorDeclaration; -import org.checkerframework.stubparser.ast.body.EmptyMemberDeclaration; -import org.checkerframework.stubparser.ast.body.EmptyTypeDeclaration; -import org.checkerframework.stubparser.ast.body.EnumConstantDeclaration; -import org.checkerframework.stubparser.ast.body.EnumDeclaration; -import org.checkerframework.stubparser.ast.body.FieldDeclaration; -import org.checkerframework.stubparser.ast.body.InitializerDeclaration; -import org.checkerframework.stubparser.ast.body.JavadocComment; -import org.checkerframework.stubparser.ast.body.MethodDeclaration; -import org.checkerframework.stubparser.ast.body.Parameter; -import org.checkerframework.stubparser.ast.body.TypeDeclaration; -import org.checkerframework.stubparser.ast.body.VariableDeclarator; -import org.checkerframework.stubparser.ast.body.VariableDeclaratorId; -import org.checkerframework.stubparser.ast.expr.AnnotationExpr; -import org.checkerframework.stubparser.ast.expr.ArrayAccessExpr; -import org.checkerframework.stubparser.ast.expr.ArrayCreationExpr; -import org.checkerframework.stubparser.ast.expr.ArrayInitializerExpr; -import org.checkerframework.stubparser.ast.expr.AssignExpr; -import org.checkerframework.stubparser.ast.expr.BinaryExpr; -import org.checkerframework.stubparser.ast.expr.BooleanLiteralExpr; -import org.checkerframework.stubparser.ast.expr.CastExpr; -import org.checkerframework.stubparser.ast.expr.CharLiteralExpr; -import org.checkerframework.stubparser.ast.expr.ClassExpr; -import org.checkerframework.stubparser.ast.expr.ConditionalExpr; -import org.checkerframework.stubparser.ast.expr.DoubleLiteralExpr; -import org.checkerframework.stubparser.ast.expr.EnclosedExpr; -import org.checkerframework.stubparser.ast.expr.Expression; -import org.checkerframework.stubparser.ast.expr.FieldAccessExpr; -import org.checkerframework.stubparser.ast.expr.InstanceOfExpr; -import org.checkerframework.stubparser.ast.expr.IntegerLiteralExpr; -import org.checkerframework.stubparser.ast.expr.IntegerLiteralMinValueExpr; -import org.checkerframework.stubparser.ast.expr.LongLiteralExpr; -import org.checkerframework.stubparser.ast.expr.LongLiteralMinValueExpr; -import org.checkerframework.stubparser.ast.expr.MarkerAnnotationExpr; -import org.checkerframework.stubparser.ast.expr.MemberValuePair; -import org.checkerframework.stubparser.ast.expr.MethodCallExpr; -import org.checkerframework.stubparser.ast.expr.NameExpr; -import org.checkerframework.stubparser.ast.expr.NormalAnnotationExpr; -import org.checkerframework.stubparser.ast.expr.NullLiteralExpr; -import org.checkerframework.stubparser.ast.expr.ObjectCreationExpr; -import org.checkerframework.stubparser.ast.expr.QualifiedNameExpr; -import org.checkerframework.stubparser.ast.expr.SingleMemberAnnotationExpr; -import org.checkerframework.stubparser.ast.expr.StringLiteralExpr; -import org.checkerframework.stubparser.ast.expr.SuperExpr; -import org.checkerframework.stubparser.ast.expr.ThisExpr; -import org.checkerframework.stubparser.ast.expr.UnaryExpr; -import org.checkerframework.stubparser.ast.expr.VariableDeclarationExpr; -import org.checkerframework.stubparser.ast.stmt.AssertStmt; -import org.checkerframework.stubparser.ast.stmt.BlockStmt; -import org.checkerframework.stubparser.ast.stmt.BreakStmt; -import org.checkerframework.stubparser.ast.stmt.CatchClause; -import org.checkerframework.stubparser.ast.stmt.ContinueStmt; -import org.checkerframework.stubparser.ast.stmt.DoStmt; -import org.checkerframework.stubparser.ast.stmt.EmptyStmt; -import org.checkerframework.stubparser.ast.stmt.ExplicitConstructorInvocationStmt; -import org.checkerframework.stubparser.ast.stmt.ExpressionStmt; -import org.checkerframework.stubparser.ast.stmt.ForStmt; -import org.checkerframework.stubparser.ast.stmt.ForeachStmt; -import org.checkerframework.stubparser.ast.stmt.IfStmt; -import org.checkerframework.stubparser.ast.stmt.LabeledStmt; -import org.checkerframework.stubparser.ast.stmt.ReturnStmt; -import org.checkerframework.stubparser.ast.stmt.Statement; -import org.checkerframework.stubparser.ast.stmt.SwitchEntryStmt; -import org.checkerframework.stubparser.ast.stmt.SwitchStmt; -import org.checkerframework.stubparser.ast.stmt.SynchronizedStmt; -import org.checkerframework.stubparser.ast.stmt.ThrowStmt; -import org.checkerframework.stubparser.ast.stmt.TryStmt; -import org.checkerframework.stubparser.ast.stmt.TypeDeclarationStmt; -import org.checkerframework.stubparser.ast.stmt.WhileStmt; -import org.checkerframework.stubparser.ast.type.ClassOrInterfaceType; -import org.checkerframework.stubparser.ast.type.PrimitiveType; -import org.checkerframework.stubparser.ast.type.ReferenceType; -import org.checkerframework.stubparser.ast.type.Type; -import org.checkerframework.stubparser.ast.type.VoidType; -import org.checkerframework.stubparser.ast.type.WildcardType; - -/** - * This visitor adapter can be used to save time when some specific nodes needs - * to be changed. To do that just extend this class and override the methods - * from the nodes who needs to be changed, returning the changed node. - * - * @author Julio Vilmar Gesser - */ -public abstract class ModifierVisitorAdapter implements GenericVisitor { - - private void removeNulls(List< ? > list) { - for (int i = list.size() - 1; i >= 0; i--) { - if (list.get(i) == null) { - list.remove(i); - } - } - } - - @Override - public Node visit(AnnotationDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); - } - List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - List members = n.getMembers(); - if (members != null) { - for (int i = 0; i < members.size(); i++) { - members.set(i, (BodyDeclaration) members.get(i).accept(this, arg)); - } - removeNulls(members); - } - return n; - } - - @Override - public Node visit(AnnotationMemberDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); - } - List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - n.setType((Type) n.getType().accept(this, arg)); - if (n.getDefaultValue() != null) { - n.setDefaultValue((Expression) n.getDefaultValue().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(ArrayAccessExpr n, A arg) { - n.setName((Expression) n.getName().accept(this, arg)); - n.setIndex((Expression) n.getIndex().accept(this, arg)); - return n; - } - - @Override - public Node visit(ArrayCreationExpr n, A arg) { - n.setType((Type) n.getType().accept(this, arg)); - if (n.getDimensions() != null) { - List dimensions = n.getDimensions(); - if (dimensions != null) { - for (int i = 0; i < dimensions.size(); i++) { - dimensions.set(i, (Expression) dimensions.get(i).accept(this, arg)); - } - removeNulls(dimensions); - } - } else { - n.setInitializer((ArrayInitializerExpr) n.getInitializer().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(ArrayInitializerExpr n, A arg) { - if (n.getValues() != null) { - List values = n.getValues(); - if (values != null) { - for (int i = 0; i < values.size(); i++) { - values.set(i, (Expression) values.get(i).accept(this, arg)); - } - removeNulls(values); - } - } - return n; - } - - @Override - public Node visit(AssertStmt n, A arg) { - n.setCheck((Expression) n.getCheck().accept(this, arg)); - if (n.getMessage() != null) { - n.setMessage((Expression) n.getMessage().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(AssignExpr n, A arg) { - n.setTarget((Expression) n.getTarget().accept(this, arg)); - n.setValue((Expression) n.getValue().accept(this, arg)); - return n; - } - - @Override - public Node visit(BinaryExpr n, A arg) { - n.setLeft((Expression) n.getLeft().accept(this, arg)); - n.setRight((Expression) n.getRight().accept(this, arg)); - return n; - } - - @Override - public Node visit(BlockStmt n, A arg) { - List stmts = n.getStmts(); - if (stmts != null) { - for (int i = 0; i < stmts.size(); i++) { - stmts.set(i, (Statement) stmts.get(i).accept(this, arg)); - } - removeNulls(stmts); - } - return n; - } - - @Override - public Node visit(BooleanLiteralExpr n, A arg) { - return n; - } - - @Override - public Node visit(BreakStmt n, A arg) { - return n; - } - - @Override - public Node visit(CastExpr n, A arg) { - n.setType((Type) n.getType().accept(this, arg)); - n.setExpr((Expression) n.getExpr().accept(this, arg)); - return n; - } - - @Override - public Node visit(CatchClause n, A arg) { - n.setExcept((Parameter) n.getExcept().accept(this, arg)); - n.setCatchBlock((BlockStmt) n.getCatchBlock().accept(this, arg)); - return n; - - } - - @Override - public Node visit(CharLiteralExpr n, A arg) { - return n; - } - - @Override - public Node visit(ClassExpr n, A arg) { - n.setType((Type) n.getType().accept(this, arg)); - return n; - } - - @Override - public Node visit(ClassOrInterfaceDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); - } - List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - List typeParameters = n.getTypeParameters(); - if (typeParameters != null) { - for (int i = 0; i < typeParameters.size(); i++) { - typeParameters.set(i, (TypeParameter) typeParameters.get(i).accept(this, arg)); - } - removeNulls(typeParameters); - } - List extendz = n.getExtends(); - if (extendz != null) { - for (int i = 0; i < extendz.size(); i++) { - extendz.set(i, (ClassOrInterfaceType) extendz.get(i).accept(this, arg)); - } - removeNulls(extendz); - } - List implementz = n.getImplements(); - if (implementz != null) { - for (int i = 0; i < implementz.size(); i++) { - implementz.set(i, (ClassOrInterfaceType) implementz.get(i).accept(this, arg)); - } - removeNulls(implementz); - } - List members = n.getMembers(); - if (members != null) { - for (int i = 0; i < members.size(); i++) { - members.set(i, (BodyDeclaration) members.get(i).accept(this, arg)); - } - removeNulls(members); - } - return n; - } - - @Override - public Node visit(ClassOrInterfaceType n, A arg) { - if (n.getScope() != null) { - n.setScope((ClassOrInterfaceType) n.getScope().accept(this, arg)); - } - List typeArgs = n.getTypeArgs(); - if (typeArgs != null) { - for (int i = 0; i < typeArgs.size(); i++) { - typeArgs.set(i, (Type) typeArgs.get(i).accept(this, arg)); - } - removeNulls(typeArgs); - } - return n; - } - - @Override - public Node visit(CompilationUnit n, A arg) { - if (n.getPackage() != null) { - n.setPackage((PackageDeclaration) n.getPackage().accept(this, arg)); - } - List imports = n.getImports(); - if (imports != null) { - for (int i = 0; i < imports.size(); i++) { - imports.set(i, (ImportDeclaration) imports.get(i).accept(this, arg)); - } - removeNulls(imports); - } - List types = n.getTypes(); - if (types != null) { - for (int i = 0; i < types.size(); i++) { - types.set(i, (TypeDeclaration) types.get(i).accept(this, arg)); - } - removeNulls(types); - } - return n; - } - - @Override - public Node visit(ConditionalExpr n, A arg) { - n.setCondition((Expression) n.getCondition().accept(this, arg)); - n.setThenExpr((Expression) n.getThenExpr().accept(this, arg)); - n.setElseExpr((Expression) n.getElseExpr().accept(this, arg)); - return n; - } - - @Override - public Node visit(ConstructorDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); - } - List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - List typeParameters = n.getTypeParameters(); - if (typeParameters != null) { - for (int i = 0; i < typeParameters.size(); i++) { - typeParameters.set(i, (TypeParameter) typeParameters.get(i).accept(this, arg)); - } - removeNulls(typeParameters); - } - List parameters = n.getParameters(); - if (parameters != null) { - for (int i = 0; i < parameters.size(); i++) { - parameters.set(i, (Parameter) parameters.get(i).accept(this, arg)); - } - removeNulls(parameters); - } - List throwz = n.getThrows(); - if (throwz != null) { - for (int i = 0; i < throwz.size(); i++) { - throwz.set(i, (NameExpr) throwz.get(i).accept(this, arg)); - } - removeNulls(throwz); - } - n.setBlock((BlockStmt) n.getBlock().accept(this, arg)); - return n; - } - - @Override - public Node visit(ContinueStmt n, A arg) { - return n; - } - - @Override - public Node visit(DoStmt n, A arg) { - n.setBody((Statement) n.getBody().accept(this, arg)); - n.setCondition((Expression) n.getCondition().accept(this, arg)); - return n; - } - - @Override - public Node visit(DoubleLiteralExpr n, A arg) { - return n; - } - - @Override - public Node visit(EmptyMemberDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(EmptyStmt n, A arg) { - return n; - } - - @Override - public Node visit(EmptyTypeDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(EnclosedExpr n, A arg) { - n.setInner((Expression) n.getInner().accept(this, arg)); - return n; - } - - @Override - public Node visit(EnumConstantDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); - } - List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - List args = n.getArgs(); - if (args != null) { - for (int i = 0; i < args.size(); i++) { - args.set(i, (Expression) args.get(i).accept(this, arg)); - } - removeNulls(args); - } - List classBody = n.getClassBody(); - if (classBody != null) { - for (int i = 0; i < classBody.size(); i++) { - classBody.set(i, (BodyDeclaration) classBody.get(i).accept(this, arg)); - } - removeNulls(classBody); - } - return n; - } - - @Override - public Node visit(EnumDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); - } - List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - List implementz = n.getImplements(); - if (implementz != null) { - for (int i = 0; i < implementz.size(); i++) { - implementz.set(i, (ClassOrInterfaceType) implementz.get(i).accept(this, arg)); - } - removeNulls(implementz); - } - List entries = n.getEntries(); - if (entries != null) { - for (int i = 0; i < entries.size(); i++) { - entries.set(i, (EnumConstantDeclaration) entries.get(i).accept(this, arg)); - } - removeNulls(entries); - } - List members = n.getMembers(); - if (members != null) { - for (int i = 0; i < members.size(); i++) { - members.set(i, (BodyDeclaration) members.get(i).accept(this, arg)); - } - removeNulls(members); - } - return n; - } - - @Override - public Node visit(ExplicitConstructorInvocationStmt n, A arg) { - if (!n.isThis()) { - if (n.getExpr() != null) { - n.setExpr((Expression) n.getExpr().accept(this, arg)); - } - } - List typeArgs = n.getTypeArgs(); - if (typeArgs != null) { - for (int i = 0; i < typeArgs.size(); i++) { - typeArgs.set(i, (Type) typeArgs.get(i).accept(this, arg)); - } - removeNulls(typeArgs); - } - List args = n.getArgs(); - if (args != null) { - for (int i = 0; i < args.size(); i++) { - args.set(i, (Expression) args.get(i).accept(this, arg)); - } - removeNulls(args); - } - return n; - } - - @Override - public Node visit(ExpressionStmt n, A arg) { - n.setExpression((Expression) n.getExpression().accept(this, arg)); - return n; - } - - @Override - public Node visit(FieldAccessExpr n, A arg) { - n.setScope((Expression) n.getScope().accept(this, arg)); - return n; - } - - @Override - public Node visit(FieldDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); - } - List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - n.setType((Type) n.getType().accept(this, arg)); - List variables = n.getVariables(); - for (int i = 0; i < variables.size(); i++) { - variables.set(i, (VariableDeclarator) variables.get(i).accept(this, arg)); - } - removeNulls(variables); - return n; - } - - @Override - public Node visit(ForeachStmt n, A arg) { - n.setVariable((VariableDeclarationExpr) n.getVariable().accept(this, arg)); - n.setIterable((Expression) n.getIterable().accept(this, arg)); - n.setBody((Statement) n.getBody().accept(this, arg)); - return n; - } - - @Override - public Node visit(ForStmt n, A arg) { - List init = n.getInit(); - if (init != null) { - for (int i = 0; i < init.size(); i++) { - init.set(i, (Expression) init.get(i).accept(this, arg)); - } - removeNulls(init); - } - if (n.getCompare() != null) { - n.setCompare((Expression) n.getCompare().accept(this, arg)); - } - List update = n.getUpdate(); - if (update != null) { - for (int i = 0; i < update.size(); i++) { - update.set(i, (Expression) update.get(i).accept(this, arg)); - } - removeNulls(update); - } - n.setBody((Statement) n.getBody().accept(this, arg)); - return n; - } - - @Override - public Node visit(IfStmt n, A arg) { - n.setCondition((Expression) n.getCondition().accept(this, arg)); - n.setThenStmt((Statement) n.getThenStmt().accept(this, arg)); - if (n.getElseStmt() != null) { - n.setElseStmt((Statement) n.getElseStmt().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(ImportDeclaration n, A arg) { - n.setName((NameExpr) n.getName().accept(this, arg)); - return n; - } - - @Override - public Node visit(InitializerDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); - } - n.setBlock((BlockStmt) n.getBlock().accept(this, arg)); - return n; - } - - @Override - public Node visit(InstanceOfExpr n, A arg) { - n.setExpr((Expression) n.getExpr().accept(this, arg)); - n.setType((Type) n.getType().accept(this, arg)); - return n; - } - - @Override - public Node visit(IntegerLiteralExpr n, A arg) { - return n; - } - - @Override - public Node visit(IntegerLiteralMinValueExpr n, A arg) { - return n; - } - - @Override - public Node visit(JavadocComment n, A arg) { - return n; - } - - @Override - public Node visit(LabeledStmt n, A arg) { - n.setStmt((Statement) n.getStmt().accept(this, arg)); - return n; - } - - @Override - public Node visit(LongLiteralExpr n, A arg) { - return n; - } - - @Override - public Node visit(LongLiteralMinValueExpr n, A arg) { - return n; - } - - @Override - public Node visit(MarkerAnnotationExpr n, A arg) { - n.setName((NameExpr) n.getName().accept(this, arg)); - return n; - } - - @Override - public Node visit(MemberValuePair n, A arg) { - n.setValue((Expression) n.getValue().accept(this, arg)); - return n; - } - - @Override - public Node visit(MethodCallExpr n, A arg) { - if (n.getScope() != null) { - n.setScope((Expression) n.getScope().accept(this, arg)); - } - List typeArgs = n.getTypeArgs(); - if (typeArgs != null) { - for (int i = 0; i < typeArgs.size(); i++) { - typeArgs.set(i, (Type) typeArgs.get(i).accept(this, arg)); - } - removeNulls(typeArgs); - } - List args = n.getArgs(); - if (args != null) { - for (int i = 0; i < args.size(); i++) { - args.set(i, (Expression) args.get(i).accept(this, arg)); - } - removeNulls(args); - } - return n; - } - - @Override - public Node visit(MethodDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); - } - List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - List typeParameters = n.getTypeParameters(); - if (typeParameters != null) { - for (int i = 0; i < typeParameters.size(); i++) { - typeParameters.set(i, (TypeParameter) typeParameters.get(i).accept(this, arg)); - } - removeNulls(typeParameters); - } - n.setType((Type) n.getType().accept(this, arg)); - List parameters = n.getParameters(); - if (parameters != null) { - for (int i = 0; i < parameters.size(); i++) { - parameters.set(i, (Parameter) parameters.get(i).accept(this, arg)); - } - removeNulls(parameters); - } - List throwz = n.getThrows(); - if (throwz != null) { - for (int i = 0; i < throwz.size(); i++) { - throwz.set(i, (NameExpr) throwz.get(i).accept(this, arg)); - } - removeNulls(throwz); - } - if (n.getBody() != null) { - n.setBody((BlockStmt) n.getBody().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(NameExpr n, A arg) { - return n; - } - - @Override - public Node visit(NormalAnnotationExpr n, A arg) { - n.setName((NameExpr) n.getName().accept(this, arg)); - List pairs = n.getPairs(); - if (pairs != null) { - for (int i = 0; i < pairs.size(); i++) { - pairs.set(i, (MemberValuePair) pairs.get(i).accept(this, arg)); - } - removeNulls(pairs); - } - return n; - } - - @Override - public Node visit(NullLiteralExpr n, A arg) { - return n; - } - - @Override - public Node visit(ObjectCreationExpr n, A arg) { - if (n.getScope() != null) { - n.setScope((Expression) n.getScope().accept(this, arg)); - } - List typeArgs = n.getTypeArgs(); - if (typeArgs != null) { - for (int i = 0; i < typeArgs.size(); i++) { - typeArgs.set(i, (Type) typeArgs.get(i).accept(this, arg)); - } - removeNulls(typeArgs); - } - n.setType((ClassOrInterfaceType) n.getType().accept(this, arg)); - List args = n.getArgs(); - if (args != null) { - for (int i = 0; i < args.size(); i++) { - args.set(i, (Expression) args.get(i).accept(this, arg)); - } - removeNulls(args); - } - List anonymousClassBody = n.getAnonymousClassBody(); - if (anonymousClassBody != null) { - for (int i = 0; i < anonymousClassBody.size(); i++) { - anonymousClassBody.set(i, (BodyDeclaration) anonymousClassBody.get(i).accept(this, arg)); - } - removeNulls(anonymousClassBody); - } - return n; - } - - @Override - public Node visit(PackageDeclaration n, A arg) { - List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - n.setName((NameExpr) n.getName().accept(this, arg)); - return n; - } - - @Override - public Node visit(Parameter n, A arg) { - List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - n.setType((Type) n.getType().accept(this, arg)); - n.setId((VariableDeclaratorId) n.getId().accept(this, arg)); - return n; - } - - @Override - public Node visit(PrimitiveType n, A arg) { - return n; - } - - @Override - public Node visit(QualifiedNameExpr n, A arg) { - n.setQualifier((NameExpr) n.getQualifier().accept(this, arg)); - return n; - } - - @Override - public Node visit(ReferenceType n, A arg) { - n.setType((Type) n.getType().accept(this, arg)); - return n; - } - - @Override - public Node visit(ReturnStmt n, A arg) { - if (n.getExpr() != null) { - n.setExpr((Expression) n.getExpr().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(SingleMemberAnnotationExpr n, A arg) { - n.setName((NameExpr) n.getName().accept(this, arg)); - n.setMemberValue((Expression) n.getMemberValue().accept(this, arg)); - return n; - } - - @Override - public Node visit(StringLiteralExpr n, A arg) { - return n; - } - - @Override - public Node visit(SuperExpr n, A arg) { - if (n.getClassExpr() != null) { - n.setClassExpr((Expression) n.getClassExpr().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(SwitchEntryStmt n, A arg) { - if (n.getLabel() != null) { - n.setLabel((Expression) n.getLabel().accept(this, arg)); - } - List stmts = n.getStmts(); - if (stmts != null) { - for (int i = 0; i < stmts.size(); i++) { - stmts.set(i, (Statement) stmts.get(i).accept(this, arg)); - } - removeNulls(stmts); - } - return n; - } - - @Override - public Node visit(SwitchStmt n, A arg) { - n.setSelector((Expression) n.getSelector().accept(this, arg)); - List entries = n.getEntries(); - if (entries != null) { - for (int i = 0; i < entries.size(); i++) { - entries.set(i, (SwitchEntryStmt) entries.get(i).accept(this, arg)); - } - removeNulls(entries); - } - return n; - - } - - @Override - public Node visit(SynchronizedStmt n, A arg) { - n.setExpr((Expression) n.getExpr().accept(this, arg)); - n.setBlock((BlockStmt) n.getBlock().accept(this, arg)); - return n; - } - - @Override - public Node visit(ThisExpr n, A arg) { - if (n.getClassExpr() != null) { - n.setClassExpr((Expression) n.getClassExpr().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(ThrowStmt n, A arg) { - n.setExpr((Expression) n.getExpr().accept(this, arg)); - return n; - } - - @Override - public Node visit(TryStmt n, A arg) { - n.setTryBlock((BlockStmt) n.getTryBlock().accept(this, arg)); - List catchs = n.getCatchs(); - if (catchs != null) { - for (int i = 0; i < catchs.size(); i++) { - catchs.set(i, (CatchClause) catchs.get(i).accept(this, arg)); - } - removeNulls(catchs); - } - if (n.getFinallyBlock() != null) { - n.setFinallyBlock((BlockStmt) n.getFinallyBlock().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(TypeDeclarationStmt n, A arg) { - n.setTypeDeclaration((TypeDeclaration) n.getTypeDeclaration().accept(this, arg)); - return n; - } - - @Override - public Node visit(TypeParameter n, A arg) { - List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - List typeBound = n.getTypeBound(); - if (typeBound != null) { - for (int i = 0; i < typeBound.size(); i++) { - typeBound.set(i, (ClassOrInterfaceType) typeBound.get(i).accept(this, arg)); - } - removeNulls(typeBound); - } - return n; - } - - @Override - public Node visit(UnaryExpr n, A arg) { - n.setExpr((Expression) n.getExpr().accept(this, arg)); - return n; - } - - @Override - public Node visit(VariableDeclarationExpr n, A arg) { - List annotations = n.getAnnotations(); - if (annotations != null) { - for (int i = 0; i < annotations.size(); i++) { - annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); - } - removeNulls(annotations); - } - n.setType((Type) n.getType().accept(this, arg)); - List vars = n.getVars(); - for (int i = 0; i < vars.size(); i++) { - vars.set(i, (VariableDeclarator) vars.get(i).accept(this, arg)); - } - removeNulls(vars); - return n; - } - - @Override - public Node visit(VariableDeclarator n, A arg) { - n.setId((VariableDeclaratorId) n.getId().accept(this, arg)); - if (n.getInit() != null) { - n.setInit((Expression) n.getInit().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(VariableDeclaratorId n, A arg) { - return n; - } - - @Override - public Node visit(VoidType n, A arg) { - return n; - } - - @Override - public Node visit(WhileStmt n, A arg) { - n.setCondition((Expression) n.getCondition().accept(this, arg)); - n.setBody((Statement) n.getBody().accept(this, arg)); - return n; - } - - @Override - public Node visit(WildcardType n, A arg) { - if (n.getExtends() != null) { - n.setExtends((ReferenceType) n.getExtends().accept(this, arg)); - } - if (n.getSuper() != null) { - n.setSuper((ReferenceType) n.getSuper().accept(this, arg)); - } - return n; - } - - @Override - public Node visit(BlockComment n, A arg) { - return n; - } - - @Override - public Node visit(LineComment n, A arg) { - return n; - } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/visitor/SimpleVoidVisitor.java b/stubparser/src/org/checkerframework/stubparser/ast/visitor/SimpleVoidVisitor.java deleted file mode 100644 index d1c165a167e..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/visitor/SimpleVoidVisitor.java +++ /dev/null @@ -1,256 +0,0 @@ -package org.checkerframework.stubparser.ast.visitor; - -import org.checkerframework.stubparser.ast.*; -import org.checkerframework.stubparser.ast.body.*; -import org.checkerframework.stubparser.ast.expr.*; -import org.checkerframework.stubparser.ast.stmt.*; -import org.checkerframework.stubparser.ast.type.*; - -public class SimpleVoidVisitor implements VoidVisitor { - public void defaultAction(Node n, A arg) { } - - public void visit(Node n, A arg) { - throw new IllegalStateException(n.getClass().getName()); - } - - @Override - public void visit(IndexUnit n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(CompilationUnit n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(PackageDeclaration n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(ImportDeclaration n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(TypeParameter n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(LineComment n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(BlockComment n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(ClassOrInterfaceDeclaration n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(EnumDeclaration n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(EmptyTypeDeclaration n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(EnumConstantDeclaration n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(AnnotationDeclaration n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(AnnotationMemberDeclaration n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(FieldDeclaration n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(VariableDeclarator n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(VariableDeclaratorId n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(ConstructorDeclaration n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(MethodDeclaration n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(Parameter n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(EmptyMemberDeclaration n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(InitializerDeclaration n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(JavadocComment n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(ClassOrInterfaceType n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(PrimitiveType n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(ReferenceType n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(VoidType n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(WildcardType n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(ArrayAccessExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(ArrayCreationExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(ArrayInitializerExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(AssignExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(BinaryExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(CastExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(ClassExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(ConditionalExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(EnclosedExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(FieldAccessExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(InstanceOfExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(StringLiteralExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(IntegerLiteralExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(LongLiteralExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(IntegerLiteralMinValueExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(LongLiteralMinValueExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(CharLiteralExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(DoubleLiteralExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(BooleanLiteralExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(NullLiteralExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(MethodCallExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(NameExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(ObjectCreationExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(QualifiedNameExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(ThisExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(SuperExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(UnaryExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(VariableDeclarationExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(MarkerAnnotationExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(SingleMemberAnnotationExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(NormalAnnotationExpr n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(MemberValuePair n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(ExplicitConstructorInvocationStmt n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(TypeDeclarationStmt n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(AssertStmt n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(BlockStmt n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(LabeledStmt n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(EmptyStmt n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(ExpressionStmt n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(SwitchStmt n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(SwitchEntryStmt n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(BreakStmt n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(ReturnStmt n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(IfStmt n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(WhileStmt n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(ContinueStmt n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(DoStmt n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(ForeachStmt n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(ForStmt n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(ThrowStmt n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(SynchronizedStmt n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(TryStmt n, A arg) { defaultAction(n, arg); } - - @Override - public void visit(CatchClause n, A arg) { defaultAction(n, arg); } - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/visitor/VoidVisitor.java b/stubparser/src/org/checkerframework/stubparser/ast/visitor/VoidVisitor.java deleted file mode 100644 index 238417b1966..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/visitor/VoidVisitor.java +++ /dev/null @@ -1,280 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package org.checkerframework.stubparser.ast.visitor; - -import org.checkerframework.stubparser.ast.BlockComment; -import org.checkerframework.stubparser.ast.CompilationUnit; -import org.checkerframework.stubparser.ast.ImportDeclaration; -import org.checkerframework.stubparser.ast.IndexUnit; -import org.checkerframework.stubparser.ast.LineComment; -import org.checkerframework.stubparser.ast.PackageDeclaration; -import org.checkerframework.stubparser.ast.TypeParameter; -import org.checkerframework.stubparser.ast.body.AnnotationDeclaration; -import org.checkerframework.stubparser.ast.body.AnnotationMemberDeclaration; -import org.checkerframework.stubparser.ast.body.ClassOrInterfaceDeclaration; -import org.checkerframework.stubparser.ast.body.ConstructorDeclaration; -import org.checkerframework.stubparser.ast.body.EmptyMemberDeclaration; -import org.checkerframework.stubparser.ast.body.EmptyTypeDeclaration; -import org.checkerframework.stubparser.ast.body.EnumConstantDeclaration; -import org.checkerframework.stubparser.ast.body.EnumDeclaration; -import org.checkerframework.stubparser.ast.body.FieldDeclaration; -import org.checkerframework.stubparser.ast.body.InitializerDeclaration; -import org.checkerframework.stubparser.ast.body.JavadocComment; -import org.checkerframework.stubparser.ast.body.MethodDeclaration; -import org.checkerframework.stubparser.ast.body.Parameter; -import org.checkerframework.stubparser.ast.body.VariableDeclarator; -import org.checkerframework.stubparser.ast.body.VariableDeclaratorId; -import org.checkerframework.stubparser.ast.expr.ArrayAccessExpr; -import org.checkerframework.stubparser.ast.expr.ArrayCreationExpr; -import org.checkerframework.stubparser.ast.expr.ArrayInitializerExpr; -import org.checkerframework.stubparser.ast.expr.AssignExpr; -import org.checkerframework.stubparser.ast.expr.BinaryExpr; -import org.checkerframework.stubparser.ast.expr.BooleanLiteralExpr; -import org.checkerframework.stubparser.ast.expr.CastExpr; -import org.checkerframework.stubparser.ast.expr.CharLiteralExpr; -import org.checkerframework.stubparser.ast.expr.ClassExpr; -import org.checkerframework.stubparser.ast.expr.ConditionalExpr; -import org.checkerframework.stubparser.ast.expr.DoubleLiteralExpr; -import org.checkerframework.stubparser.ast.expr.EnclosedExpr; -import org.checkerframework.stubparser.ast.expr.FieldAccessExpr; -import org.checkerframework.stubparser.ast.expr.InstanceOfExpr; -import org.checkerframework.stubparser.ast.expr.IntegerLiteralExpr; -import org.checkerframework.stubparser.ast.expr.IntegerLiteralMinValueExpr; -import org.checkerframework.stubparser.ast.expr.LongLiteralExpr; -import org.checkerframework.stubparser.ast.expr.LongLiteralMinValueExpr; -import org.checkerframework.stubparser.ast.expr.MarkerAnnotationExpr; -import org.checkerframework.stubparser.ast.expr.MemberValuePair; -import org.checkerframework.stubparser.ast.expr.MethodCallExpr; -import org.checkerframework.stubparser.ast.expr.NameExpr; -import org.checkerframework.stubparser.ast.expr.NormalAnnotationExpr; -import org.checkerframework.stubparser.ast.expr.NullLiteralExpr; -import org.checkerframework.stubparser.ast.expr.ObjectCreationExpr; -import org.checkerframework.stubparser.ast.expr.QualifiedNameExpr; -import org.checkerframework.stubparser.ast.expr.SingleMemberAnnotationExpr; -import org.checkerframework.stubparser.ast.expr.StringLiteralExpr; -import org.checkerframework.stubparser.ast.expr.SuperExpr; -import org.checkerframework.stubparser.ast.expr.ThisExpr; -import org.checkerframework.stubparser.ast.expr.UnaryExpr; -import org.checkerframework.stubparser.ast.expr.VariableDeclarationExpr; -import org.checkerframework.stubparser.ast.stmt.AssertStmt; -import org.checkerframework.stubparser.ast.stmt.BlockStmt; -import org.checkerframework.stubparser.ast.stmt.BreakStmt; -import org.checkerframework.stubparser.ast.stmt.CatchClause; -import org.checkerframework.stubparser.ast.stmt.ContinueStmt; -import org.checkerframework.stubparser.ast.stmt.DoStmt; -import org.checkerframework.stubparser.ast.stmt.EmptyStmt; -import org.checkerframework.stubparser.ast.stmt.ExplicitConstructorInvocationStmt; -import org.checkerframework.stubparser.ast.stmt.ExpressionStmt; -import org.checkerframework.stubparser.ast.stmt.ForStmt; -import org.checkerframework.stubparser.ast.stmt.ForeachStmt; -import org.checkerframework.stubparser.ast.stmt.IfStmt; -import org.checkerframework.stubparser.ast.stmt.LabeledStmt; -import org.checkerframework.stubparser.ast.stmt.ReturnStmt; -import org.checkerframework.stubparser.ast.stmt.SwitchEntryStmt; -import org.checkerframework.stubparser.ast.stmt.SwitchStmt; -import org.checkerframework.stubparser.ast.stmt.SynchronizedStmt; -import org.checkerframework.stubparser.ast.stmt.ThrowStmt; -import org.checkerframework.stubparser.ast.stmt.TryStmt; -import org.checkerframework.stubparser.ast.stmt.TypeDeclarationStmt; -import org.checkerframework.stubparser.ast.stmt.WhileStmt; -import org.checkerframework.stubparser.ast.type.ClassOrInterfaceType; -import org.checkerframework.stubparser.ast.type.PrimitiveType; -import org.checkerframework.stubparser.ast.type.ReferenceType; -import org.checkerframework.stubparser.ast.type.VoidType; -import org.checkerframework.stubparser.ast.type.WildcardType; - -/** - * @author Julio Vilmar Gesser - */ -public interface VoidVisitor { - - //- Compilation Unit ---------------------------------- - - public void visit(IndexUnit n, A arg); - - public void visit(CompilationUnit n, A arg); - - public void visit(PackageDeclaration n, A arg); - - public void visit(ImportDeclaration n, A arg); - - public void visit(TypeParameter n, A arg); - - public void visit(LineComment n, A arg); - - public void visit(BlockComment n, A arg); - - //- Body ---------------------------------------------- - - public void visit(ClassOrInterfaceDeclaration n, A arg); - - public void visit(EnumDeclaration n, A arg); - - public void visit(EmptyTypeDeclaration n, A arg); - - public void visit(EnumConstantDeclaration n, A arg); - - public void visit(AnnotationDeclaration n, A arg); - - public void visit(AnnotationMemberDeclaration n, A arg); - - public void visit(FieldDeclaration n, A arg); - - public void visit(VariableDeclarator n, A arg); - - public void visit(VariableDeclaratorId n, A arg); - - public void visit(ConstructorDeclaration n, A arg); - - public void visit(MethodDeclaration n, A arg); - - public void visit(Parameter n, A arg); - - public void visit(EmptyMemberDeclaration n, A arg); - - public void visit(InitializerDeclaration n, A arg); - - public void visit(JavadocComment n, A arg); - - //- Type ---------------------------------------------- - - public void visit(ClassOrInterfaceType n, A arg); - - public void visit(PrimitiveType n, A arg); - - public void visit(ReferenceType n, A arg); - - public void visit(VoidType n, A arg); - - public void visit(WildcardType n, A arg); - - //- Expression ---------------------------------------- - - public void visit(ArrayAccessExpr n, A arg); - - public void visit(ArrayCreationExpr n, A arg); - - public void visit(ArrayInitializerExpr n, A arg); - - public void visit(AssignExpr n, A arg); - - public void visit(BinaryExpr n, A arg); - - public void visit(CastExpr n, A arg); - - public void visit(ClassExpr n, A arg); - - public void visit(ConditionalExpr n, A arg); - - public void visit(EnclosedExpr n, A arg); - - public void visit(FieldAccessExpr n, A arg); - - public void visit(InstanceOfExpr n, A arg); - - public void visit(StringLiteralExpr n, A arg); - - public void visit(IntegerLiteralExpr n, A arg); - - public void visit(LongLiteralExpr n, A arg); - - public void visit(IntegerLiteralMinValueExpr n, A arg); - - public void visit(LongLiteralMinValueExpr n, A arg); - - public void visit(CharLiteralExpr n, A arg); - - public void visit(DoubleLiteralExpr n, A arg); - - public void visit(BooleanLiteralExpr n, A arg); - - public void visit(NullLiteralExpr n, A arg); - - public void visit(MethodCallExpr n, A arg); - - public void visit(NameExpr n, A arg); - - public void visit(ObjectCreationExpr n, A arg); - - public void visit(QualifiedNameExpr n, A arg); - - public void visit(ThisExpr n, A arg); - - public void visit(SuperExpr n, A arg); - - public void visit(UnaryExpr n, A arg); - - public void visit(VariableDeclarationExpr n, A arg); - - public void visit(MarkerAnnotationExpr n, A arg); - - public void visit(SingleMemberAnnotationExpr n, A arg); - - public void visit(NormalAnnotationExpr n, A arg); - - public void visit(MemberValuePair n, A arg); - - //- Statements ---------------------------------------- - - public void visit(ExplicitConstructorInvocationStmt n, A arg); - - public void visit(TypeDeclarationStmt n, A arg); - - public void visit(AssertStmt n, A arg); - - public void visit(BlockStmt n, A arg); - - public void visit(LabeledStmt n, A arg); - - public void visit(EmptyStmt n, A arg); - - public void visit(ExpressionStmt n, A arg); - - public void visit(SwitchStmt n, A arg); - - public void visit(SwitchEntryStmt n, A arg); - - public void visit(BreakStmt n, A arg); - - public void visit(ReturnStmt n, A arg); - - public void visit(IfStmt n, A arg); - - public void visit(WhileStmt n, A arg); - - public void visit(ContinueStmt n, A arg); - - public void visit(DoStmt n, A arg); - - public void visit(ForeachStmt n, A arg); - - public void visit(ForStmt n, A arg); - - public void visit(ThrowStmt n, A arg); - - public void visit(SynchronizedStmt n, A arg); - - public void visit(TryStmt n, A arg); - - public void visit(CatchClause n, A arg); - -} diff --git a/stubparser/src/org/checkerframework/stubparser/ast/visitor/VoidVisitorAdapter.java b/stubparser/src/org/checkerframework/stubparser/ast/visitor/VoidVisitorAdapter.java deleted file mode 100644 index fd5e9a7b958..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/ast/visitor/VoidVisitorAdapter.java +++ /dev/null @@ -1,835 +0,0 @@ -/* - * Copyright (C) 2008 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 09/06/2008 - */ -package org.checkerframework.stubparser.ast.visitor; - -import org.checkerframework.stubparser.ast.BlockComment; -import org.checkerframework.stubparser.ast.CompilationUnit; -import org.checkerframework.stubparser.ast.ImportDeclaration; -import org.checkerframework.stubparser.ast.IndexUnit; -import org.checkerframework.stubparser.ast.LineComment; -import org.checkerframework.stubparser.ast.PackageDeclaration; -import org.checkerframework.stubparser.ast.TypeParameter; -import org.checkerframework.stubparser.ast.body.AnnotationDeclaration; -import org.checkerframework.stubparser.ast.body.AnnotationMemberDeclaration; -import org.checkerframework.stubparser.ast.body.BodyDeclaration; -import org.checkerframework.stubparser.ast.body.ClassOrInterfaceDeclaration; -import org.checkerframework.stubparser.ast.body.ConstructorDeclaration; -import org.checkerframework.stubparser.ast.body.EmptyMemberDeclaration; -import org.checkerframework.stubparser.ast.body.EmptyTypeDeclaration; -import org.checkerframework.stubparser.ast.body.EnumConstantDeclaration; -import org.checkerframework.stubparser.ast.body.EnumDeclaration; -import org.checkerframework.stubparser.ast.body.FieldDeclaration; -import org.checkerframework.stubparser.ast.body.InitializerDeclaration; -import org.checkerframework.stubparser.ast.body.JavadocComment; -import org.checkerframework.stubparser.ast.body.MethodDeclaration; -import org.checkerframework.stubparser.ast.body.Parameter; -import org.checkerframework.stubparser.ast.body.TypeDeclaration; -import org.checkerframework.stubparser.ast.body.VariableDeclarator; -import org.checkerframework.stubparser.ast.body.VariableDeclaratorId; -import org.checkerframework.stubparser.ast.expr.AnnotationExpr; -import org.checkerframework.stubparser.ast.expr.ArrayAccessExpr; -import org.checkerframework.stubparser.ast.expr.ArrayCreationExpr; -import org.checkerframework.stubparser.ast.expr.ArrayInitializerExpr; -import org.checkerframework.stubparser.ast.expr.AssignExpr; -import org.checkerframework.stubparser.ast.expr.BinaryExpr; -import org.checkerframework.stubparser.ast.expr.BooleanLiteralExpr; -import org.checkerframework.stubparser.ast.expr.CastExpr; -import org.checkerframework.stubparser.ast.expr.CharLiteralExpr; -import org.checkerframework.stubparser.ast.expr.ClassExpr; -import org.checkerframework.stubparser.ast.expr.ConditionalExpr; -import org.checkerframework.stubparser.ast.expr.DoubleLiteralExpr; -import org.checkerframework.stubparser.ast.expr.EnclosedExpr; -import org.checkerframework.stubparser.ast.expr.Expression; -import org.checkerframework.stubparser.ast.expr.FieldAccessExpr; -import org.checkerframework.stubparser.ast.expr.InstanceOfExpr; -import org.checkerframework.stubparser.ast.expr.IntegerLiteralExpr; -import org.checkerframework.stubparser.ast.expr.IntegerLiteralMinValueExpr; -import org.checkerframework.stubparser.ast.expr.LongLiteralExpr; -import org.checkerframework.stubparser.ast.expr.LongLiteralMinValueExpr; -import org.checkerframework.stubparser.ast.expr.MarkerAnnotationExpr; -import org.checkerframework.stubparser.ast.expr.MemberValuePair; -import org.checkerframework.stubparser.ast.expr.MethodCallExpr; -import org.checkerframework.stubparser.ast.expr.NameExpr; -import org.checkerframework.stubparser.ast.expr.NormalAnnotationExpr; -import org.checkerframework.stubparser.ast.expr.NullLiteralExpr; -import org.checkerframework.stubparser.ast.expr.ObjectCreationExpr; -import org.checkerframework.stubparser.ast.expr.QualifiedNameExpr; -import org.checkerframework.stubparser.ast.expr.SingleMemberAnnotationExpr; -import org.checkerframework.stubparser.ast.expr.StringLiteralExpr; -import org.checkerframework.stubparser.ast.expr.SuperExpr; -import org.checkerframework.stubparser.ast.expr.ThisExpr; -import org.checkerframework.stubparser.ast.expr.UnaryExpr; -import org.checkerframework.stubparser.ast.expr.VariableDeclarationExpr; -import org.checkerframework.stubparser.ast.stmt.AssertStmt; -import org.checkerframework.stubparser.ast.stmt.BlockStmt; -import org.checkerframework.stubparser.ast.stmt.BreakStmt; -import org.checkerframework.stubparser.ast.stmt.CatchClause; -import org.checkerframework.stubparser.ast.stmt.ContinueStmt; -import org.checkerframework.stubparser.ast.stmt.DoStmt; -import org.checkerframework.stubparser.ast.stmt.EmptyStmt; -import org.checkerframework.stubparser.ast.stmt.ExplicitConstructorInvocationStmt; -import org.checkerframework.stubparser.ast.stmt.ExpressionStmt; -import org.checkerframework.stubparser.ast.stmt.ForStmt; -import org.checkerframework.stubparser.ast.stmt.ForeachStmt; -import org.checkerframework.stubparser.ast.stmt.IfStmt; -import org.checkerframework.stubparser.ast.stmt.LabeledStmt; -import org.checkerframework.stubparser.ast.stmt.ReturnStmt; -import org.checkerframework.stubparser.ast.stmt.Statement; -import org.checkerframework.stubparser.ast.stmt.SwitchEntryStmt; -import org.checkerframework.stubparser.ast.stmt.SwitchStmt; -import org.checkerframework.stubparser.ast.stmt.SynchronizedStmt; -import org.checkerframework.stubparser.ast.stmt.ThrowStmt; -import org.checkerframework.stubparser.ast.stmt.TryStmt; -import org.checkerframework.stubparser.ast.stmt.TypeDeclarationStmt; -import org.checkerframework.stubparser.ast.stmt.WhileStmt; -import org.checkerframework.stubparser.ast.type.ClassOrInterfaceType; -import org.checkerframework.stubparser.ast.type.PrimitiveType; -import org.checkerframework.stubparser.ast.type.ReferenceType; -import org.checkerframework.stubparser.ast.type.Type; -import org.checkerframework.stubparser.ast.type.VoidType; -import org.checkerframework.stubparser.ast.type.WildcardType; - -/** - * @author Julio Vilmar Gesser - */ -public abstract class VoidVisitorAdapter implements VoidVisitor { - - @Override - public void visit(AnnotationDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getMembers() != null) { - for (BodyDeclaration member : n.getMembers()) { - member.accept(this, arg); - } - } - } - - @Override - public void visit(AnnotationMemberDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - n.getType().accept(this, arg); - if (n.getDefaultValue() != null) { - n.getDefaultValue().accept(this, arg); - } - } - - @Override - public void visit(ArrayAccessExpr n, A arg) { - n.getName().accept(this, arg); - n.getIndex().accept(this, arg); - } - - @Override - public void visit(ArrayCreationExpr n, A arg) { - n.getType().accept(this, arg); - if (n.getDimensions() != null) { - for (Expression dim : n.getDimensions()) { - dim.accept(this, arg); - } - } else { - n.getInitializer().accept(this, arg); - } - } - - @Override - public void visit(ArrayInitializerExpr n, A arg) { - if (n.getValues() != null) { - for (Expression expr : n.getValues()) { - expr.accept(this, arg); - } - } - } - - @Override - public void visit(AssertStmt n, A arg) { - n.getCheck().accept(this, arg); - if (n.getMessage() != null) { - n.getMessage().accept(this, arg); - } - } - - @Override - public void visit(AssignExpr n, A arg) { - n.getTarget().accept(this, arg); - n.getValue().accept(this, arg); - } - - @Override - public void visit(BinaryExpr n, A arg) { - n.getLeft().accept(this, arg); - n.getRight().accept(this, arg); - } - - @Override - public void visit(BlockComment n, A arg) { - } - - @Override - public void visit(BlockStmt n, A arg) { - if (n.getStmts() != null) { - for (Statement s : n.getStmts()) { - s.accept(this, arg); - } - } - } - - @Override - public void visit(BooleanLiteralExpr n, A arg) { - } - - @Override - public void visit(BreakStmt n, A arg) { - } - - @Override - public void visit(CastExpr n, A arg) { - n.getType().accept(this, arg); - n.getExpr().accept(this, arg); - } - - @Override - public void visit(CatchClause n, A arg) { - n.getExcept().accept(this, arg); - n.getCatchBlock().accept(this, arg); - } - - @Override - public void visit(CharLiteralExpr n, A arg) { - } - - @Override - public void visit(ClassExpr n, A arg) { - n.getType().accept(this, arg); - } - - @Override - public void visit(ClassOrInterfaceDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getTypeParameters() != null) { - for (TypeParameter t : n.getTypeParameters()) { - t.accept(this, arg); - } - } - if (n.getExtends() != null) { - for (ClassOrInterfaceType c : n.getExtends()) { - c.accept(this, arg); - } - } - - if (n.getImplements() != null) { - for (ClassOrInterfaceType c : n.getImplements()) { - c.accept(this, arg); - } - } - if (n.getMembers() != null) { - for (BodyDeclaration member : n.getMembers()) { - member.accept(this, arg); - } - } - } - - @Override - public void visit(ClassOrInterfaceType n, A arg) { - if (n.getScope() != null) { - n.getScope().accept(this, arg); - } - if (n.getTypeArgs() != null) { - for (Type t : n.getTypeArgs()) { - t.accept(this, arg); - } - } - } - - @Override - public void visit(CompilationUnit n, A arg) { - if (n.getPackage() != null) { - n.getPackage().accept(this, arg); - } - if (n.getImports() != null) { - for (ImportDeclaration i : n.getImports()) { - i.accept(this, arg); - } - } - if (n.getTypes() != null) { - for (TypeDeclaration typeDeclaration : n.getTypes()) { - typeDeclaration.accept(this, arg); - } - } - } - - @Override - public void visit(ConditionalExpr n, A arg) { - n.getCondition().accept(this, arg); - n.getThenExpr().accept(this, arg); - n.getElseExpr().accept(this, arg); - } - - @Override - public void visit(ConstructorDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getTypeParameters() != null) { - for (TypeParameter t : n.getTypeParameters()) { - t.accept(this, arg); - } - } - if (n.getParameters() != null) { - for (Parameter p : n.getParameters()) { - p.accept(this, arg); - } - } - if (n.getThrows() != null) { - for (NameExpr name : n.getThrows()) { - name.accept(this, arg); - } - } - n.getBlock().accept(this, arg); - } - - @Override - public void visit(ContinueStmt n, A arg) { - } - - @Override - public void visit(DoStmt n, A arg) { - n.getBody().accept(this, arg); - n.getCondition().accept(this, arg); - } - - @Override - public void visit(DoubleLiteralExpr n, A arg) { - } - - @Override - public void visit(EmptyMemberDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - } - - @Override - public void visit(EmptyStmt n, A arg) { - } - - @Override - public void visit(EmptyTypeDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - } - - @Override - public void visit(EnclosedExpr n, A arg) { - n.getInner().accept(this, arg); - } - - @Override - public void visit(EnumConstantDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getArgs() != null) { - for (Expression e : n.getArgs()) { - e.accept(this, arg); - } - } - if (n.getClassBody() != null) { - for (BodyDeclaration member : n.getClassBody()) { - member.accept(this, arg); - } - } - } - - @Override - public void visit(EnumDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getImplements() != null) { - for (ClassOrInterfaceType c : n.getImplements()) { - c.accept(this, arg); - } - } - if (n.getEntries() != null) { - for (EnumConstantDeclaration e : n.getEntries()) { - e.accept(this, arg); - } - } - if (n.getMembers() != null) { - for (BodyDeclaration member : n.getMembers()) { - member.accept(this, arg); - } - } - } - - @Override - public void visit(ExplicitConstructorInvocationStmt n, A arg) { - if (!n.isThis()) { - if (n.getExpr() != null) { - n.getExpr().accept(this, arg); - } - } - if (n.getTypeArgs() != null) { - for (Type t : n.getTypeArgs()) { - t.accept(this, arg); - } - } - if (n.getArgs() != null) { - for (Expression e : n.getArgs()) { - e.accept(this, arg); - } - } - } - - @Override - public void visit(ExpressionStmt n, A arg) { - n.getExpression().accept(this, arg); - } - - @Override - public void visit(FieldAccessExpr n, A arg) { - n.getScope().accept(this, arg); - } - - @Override - public void visit(FieldDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - n.getType().accept(this, arg); - for (VariableDeclarator var : n.getVariables()) { - var.accept(this, arg); - } - } - - @Override - public void visit(ForeachStmt n, A arg) { - n.getVariable().accept(this, arg); - n.getIterable().accept(this, arg); - n.getBody().accept(this, arg); - } - - @Override - public void visit(ForStmt n, A arg) { - if (n.getInit() != null) { - for (Expression e : n.getInit()) { - e.accept(this, arg); - } - } - if (n.getCompare() != null) { - n.getCompare().accept(this, arg); - } - if (n.getUpdate() != null) { - for (Expression e : n.getUpdate()) { - e.accept(this, arg); - } - } - n.getBody().accept(this, arg); - } - - @Override - public void visit(IfStmt n, A arg) { - n.getCondition().accept(this, arg); - n.getThenStmt().accept(this, arg); - if (n.getElseStmt() != null) { - n.getElseStmt().accept(this, arg); - } - } - - @Override - public void visit(ImportDeclaration n, A arg) { - n.getName().accept(this, arg); - } - - @Override - public void visit(InitializerDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - n.getBlock().accept(this, arg); - } - - @Override - public void visit(InstanceOfExpr n, A arg) { - n.getExpr().accept(this, arg); - n.getType().accept(this, arg); - } - - @Override - public void visit(IntegerLiteralExpr n, A arg) { - } - - @Override - public void visit(IntegerLiteralMinValueExpr n, A arg) { - } - - @Override - public void visit(JavadocComment n, A arg) { - } - - @Override - public void visit(LabeledStmt n, A arg) { - n.getStmt().accept(this, arg); - } - - @Override - public void visit(LineComment n, A arg) { - } - - @Override - public void visit(LongLiteralExpr n, A arg) { - } - - @Override - public void visit(LongLiteralMinValueExpr n, A arg) { - } - - @Override - public void visit(MarkerAnnotationExpr n, A arg) { - n.getName().accept(this, arg); - } - - @Override - public void visit(MemberValuePair n, A arg) { - n.getValue().accept(this, arg); - } - - @Override - public void visit(MethodCallExpr n, A arg) { - if (n.getScope() != null) { - n.getScope().accept(this, arg); - } - if (n.getTypeArgs() != null) { - for (Type t : n.getTypeArgs()) { - t.accept(this, arg); - } - } - if (n.getArgs() != null) { - for (Expression e : n.getArgs()) { - e.accept(this, arg); - } - } - } - - @Override - public void visit(MethodDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getTypeParameters() != null) { - for (TypeParameter t : n.getTypeParameters()) { - t.accept(this, arg); - } - } - n.getType().accept(this, arg); - if (n.getParameters() != null) { - for (Parameter p : n.getParameters()) { - p.accept(this, arg); - } - } - if (n.getThrows() != null) { - for (NameExpr name : n.getThrows()) { - name.accept(this, arg); - } - } - if (n.getBody() != null) { - n.getBody().accept(this, arg); - } - } - - @Override - public void visit(NameExpr n, A arg) { - } - - @Override - public void visit(NormalAnnotationExpr n, A arg) { - n.getName().accept(this, arg); - if (n.getPairs() != null) { - for (MemberValuePair m : n.getPairs()) { - m.accept(this, arg); - } - } - } - - @Override - public void visit(NullLiteralExpr n, A arg) { - } - - @Override - public void visit(ObjectCreationExpr n, A arg) { - if (n.getScope() != null) { - n.getScope().accept(this, arg); - } - if (n.getTypeArgs() != null) { - for (Type t : n.getTypeArgs()) { - t.accept(this, arg); - } - } - n.getType().accept(this, arg); - if (n.getArgs() != null) { - for (Expression e : n.getArgs()) { - e.accept(this, arg); - } - } - if (n.getAnonymousClassBody() != null) { - for (BodyDeclaration member : n.getAnonymousClassBody()) { - member.accept(this, arg); - } - } - } - - @Override - public void visit(PackageDeclaration n, A arg) { - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - n.getName().accept(this, arg); - } - - @Override - public void visit(Parameter n, A arg) { - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - n.getType().accept(this, arg); - n.getId().accept(this, arg); - } - - @Override - public void visit(PrimitiveType n, A arg) { - } - - @Override - public void visit(QualifiedNameExpr n, A arg) { - n.getQualifier().accept(this, arg); - } - - @Override - public void visit(ReferenceType n, A arg) { - n.getType().accept(this, arg); - } - - @Override - public void visit(ReturnStmt n, A arg) { - if (n.getExpr() != null) { - n.getExpr().accept(this, arg); - } - } - - @Override - public void visit(SingleMemberAnnotationExpr n, A arg) { - n.getName().accept(this, arg); - n.getMemberValue().accept(this, arg); - } - - @Override - public void visit(StringLiteralExpr n, A arg) { - } - - @Override - public void visit(SuperExpr n, A arg) { - if (n.getClassExpr() != null) { - n.getClassExpr().accept(this, arg); - } - } - - @Override - public void visit(SwitchEntryStmt n, A arg) { - if (n.getLabel() != null) { - n.getLabel().accept(this, arg); - } - if (n.getStmts() != null) { - for (Statement s : n.getStmts()) { - s.accept(this, arg); - } - } - } - - @Override - public void visit(SwitchStmt n, A arg) { - n.getSelector().accept(this, arg); - if (n.getEntries() != null) { - for (SwitchEntryStmt e : n.getEntries()) { - e.accept(this, arg); - } - } - } - - @Override - public void visit(SynchronizedStmt n, A arg) { - n.getExpr().accept(this, arg); - n.getBlock().accept(this, arg); - - } - - @Override - public void visit(ThisExpr n, A arg) { - if (n.getClassExpr() != null) { - n.getClassExpr().accept(this, arg); - } - } - - @Override - public void visit(ThrowStmt n, A arg) { - n.getExpr().accept(this, arg); - } - - @Override - public void visit(TryStmt n, A arg) { - n.getTryBlock().accept(this, arg); - if (n.getCatchs() != null) { - for (CatchClause c : n.getCatchs()) { - c.accept(this, arg); - } - } - if (n.getFinallyBlock() != null) { - n.getFinallyBlock().accept(this, arg); - } - } - - @Override - public void visit(TypeDeclarationStmt n, A arg) { - n.getTypeDeclaration().accept(this, arg); - } - - @Override - public void visit(TypeParameter n, A arg) { - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getTypeBound() != null) { - for (ClassOrInterfaceType c : n.getTypeBound()) { - c.accept(this, arg); - } - } - } - - @Override - public void visit(UnaryExpr n, A arg) { - n.getExpr().accept(this, arg); - } - - @Override - public void visit(VariableDeclarationExpr n, A arg) { - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - n.getType().accept(this, arg); - for (VariableDeclarator v : n.getVars()) { - v.accept(this, arg); - } - } - - @Override - public void visit(VariableDeclarator n, A arg) { - n.getId().accept(this, arg); - if (n.getInit() != null) { - n.getInit().accept(this, arg); - } - } - - @Override - public void visit(VariableDeclaratorId n, A arg) { - } - - @Override - public void visit(VoidType n, A arg) { - } - - @Override - public void visit(WhileStmt n, A arg) { - n.getCondition().accept(this, arg); - n.getBody().accept(this, arg); - } - - @Override - public void visit(WildcardType n, A arg) { - if (n.getExtends() != null) { - n.getExtends().accept(this, arg); - } - if (n.getSuper() != null) { - n.getSuper().accept(this, arg); - } - } - - @Override - public void visit(IndexUnit n, A arg) { - for (CompilationUnit unit : n.getCompilationUnits()) { - unit.accept(this, arg); - } - } -} diff --git a/stubparser/src/org/checkerframework/stubparser/java_1_5.jj b/stubparser/src/org/checkerframework/stubparser/java_1_5.jj deleted file mode 100644 index 378d50adc3e..00000000000 --- a/stubparser/src/org/checkerframework/stubparser/java_1_5.jj +++ /dev/null @@ -1,3190 +0,0 @@ -/* - * Copyright (C) 2008 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ - -options { - LOOKAHEAD=1; - STATIC=false; - JAVA_UNICODE_ESCAPE=true; - COMMON_TOKEN_ACTION=true; - //SUPPORT_CLASS_VISIBILITY_PUBLIC=false; - JDK_VERSION = "1.5"; - TOKEN_FACTORY = "ASTParser.GTToken"; -} - -PARSER_BEGIN(ASTParser) -/* - * Copyright (C) 2008 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -package org.checkerframework.stubparser; - -import java.io.*; -import java.util.*; -import org.checkerframework.stubparser.ast.*; -import org.checkerframework.stubparser.ast.body.*; -import org.checkerframework.stubparser.ast.expr.*; -import org.checkerframework.stubparser.ast.stmt.*; -import org.checkerframework.stubparser.ast.type.*; - -/** - *

This class was generated automatically by javacc, do not edit.

- * @author Júlio Vilmar Gesser - */ -final class ASTParser { - - void reset(InputStream in, String encoding) { - ReInit(in, encoding); - token_source.clearComments(); - } - - private List add(List list, Object obj) { - if (list == null) { - list = new LinkedList(); - } - list.add(obj); - return list; - } - - private List add(int pos, List list, Object obj) { - if (list == null) { - list = new LinkedList(); - } - list.add(pos, obj); - return list; - } - - private class Modifier { - - final int modifiers; - final List annotations; - final int beginLine; - final int beginColumn; - - public Modifier(int beginLine, int beginColumn, int modifiers, List annotations) { - this.beginLine = beginLine; - this.beginColumn = beginColumn; - this.modifiers = modifiers; - this.annotations = annotations; - } - } - - public int addModifier(int modifiers, int mod, Token token) throws ParseException { - if ((ModifierSet.hasModifier(modifiers, mod))) { - throwParseException(token, "Duplicated modifier"); - } - return ModifierSet.addModifier(modifiers, mod); - } - - private void pushJavadoc() { - token_source.pushJavadoc(); - } - - private JavadocComment popJavadoc() { - return token_source.popJavadoc(); - } - - private List getComments() { - return token_source.getComments(); - } - - private void throwParseException(Token token, String message) throws ParseException { - StringBuilder buf = new StringBuilder(); - buf.append(message); - buf.append(": \""); - buf.append(token.image); - buf.append("\" at line "); - buf.append(token.beginLine); - buf.append(", column "); - buf.append(token.beginColumn); - ParseException e = new ParseException(buf.toString()); - e.currentToken = token; - throw e; - } - - static final class GTToken extends Token { - - int realKind = ASTParserConstants.GT; - - GTToken(int kind, String image) { - this.kind = kind; - this.image = image; - } - - public static Token newToken(int kind, String image) { - return new GTToken(kind, image); - } - } -} - -PARSER_END(ASTParser) - -/* WHITE SPACE */ - -SKIP : -{ - " " -| "\t" -| "\n" -| "\r" -| "\f" -} - -/* COMMENTS */ - -TOKEN_MGR_DECLS : -{ - private List comments; - private final Stack javadocStack = new Stack(); - private JavadocComment lastJavadoc; - - void pushJavadoc() { - javadocStack.push(lastJavadoc); - } - - JavadocComment popJavadoc() { - return javadocStack.pop(); - } - - List getComments() { - return comments; - } - - void clearComments() { - comments = null; - javadocStack.clear(); - lastJavadoc = null; - } - - private void CommonTokenAction(Token token) { - lastJavadoc = null; - if (token.specialToken != null) { - if(comments == null) { - comments = new LinkedList(); - } - Token special = token.specialToken; - if(special.kind == JAVA_DOC_COMMENT) { - lastJavadoc = new JavadocComment(special.beginLine, special.beginColumn, special.endLine, special.endColumn, special.image.substring(3, special.image.length()-2)); - comments.add(lastJavadoc); - } else if(special.kind == SINGLE_LINE_COMMENT) { - LineComment comment = new LineComment(special.beginLine, special.beginColumn, special.endLine, special.endColumn, special.image.substring(2)); - comments.add(comment); - } else if(special.kind == MULTI_LINE_COMMENT) { - BlockComment comment = new BlockComment(special.beginLine, special.beginColumn, special.endLine, special.endColumn, special.image.substring(2, special.image.length()-2)); - comments.add(comment); - } - } - } -} - -SPECIAL_TOKEN : -{ - -} - -MORE : -{ - <"/**" ~["/"]> { input_stream.backup(1); } : IN_JAVA_DOC_COMMENT -| - <"/*"> : IN_MULTI_LINE_COMMENT -} - - -SPECIAL_TOKEN : -{ - : DEFAULT -} - - -SPECIAL_TOKEN : -{ - : DEFAULT -} - - -MORE : -{ - < ~[] > -} - -/* RESERVED WORDS AND LITERALS */ - -TOKEN : -{ - < ABSTRACT: "abstract" > -| < ASSERT: "assert" > -| < BOOLEAN: "boolean" > -| < BREAK: "break" > -| < BYTE: "byte" > -| < CASE: "case" > -| < CATCH: "catch" > -| < CHAR: "char" > -| < CLASS: "class" > -| < CONST: "const" > -| < CONTINUE: "continue" > -| < _DEFAULT: "default" > -| < DO: "do" > -| < DOUBLE: "double" > -| < ELSE: "else" > -| < ENUM: "enum" > -| < EXTENDS: "extends" > -| < FALSE: "false" > -| < FINAL: "final" > -| < FINALLY: "finally" > -| < FLOAT: "float" > -| < FOR: "for" > -| < GOTO: "goto" > -| < IF: "if" > -| < IMPLEMENTS: "implements" > -| < IMPORT: "import" > -| < INSTANCEOF: "instanceof" > -| < INT: "int" > -| < INTERFACE: "interface" > -| < LONG: "long" > -| < NATIVE: "native" > -| < NEW: "new" > -| < NULL: "null" > -| < PACKAGE: "package"> -| < PRIVATE: "private" > -| < PROTECTED: "protected" > -| < PUBLIC: "public" > -| < RETURN: "return" > -| < SHORT: "short" > -| < STATIC: "static" > -| < STRICTFP: "strictfp" > -| < SUPER: "super" > -| < SWITCH: "switch" > -| < SYNCHRONIZED: "synchronized" > -| < THIS: "this" > -| < THROW: "throw" > -| < THROWS: "throws" > -| < TRANSIENT: "transient" > -| < TRUE: "true" > -| < TRY: "try" > -| < VOID: "void" > -| < VOLATILE: "volatile" > -| < WHILE: "while" > -} - -/* LITERALS */ - -TOKEN : -{ - < LONG_LITERAL: - (["l","L"]) - | (["l","L"]) - | (["l","L"]) - > -| - < INTEGER_LITERAL: - - | - | - > -| - < #DECIMAL_LITERAL: ["1"-"9"] (["0"-"9"])* > -| - < #HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+ > -| - < #OCTAL_LITERAL: "0" (["0"-"7"])* > -| - < FLOATING_POINT_LITERAL: - - | - > -| - < #DECIMAL_FLOATING_POINT_LITERAL: - (["0"-"9"])+ "." (["0"-"9"])* ()? (["f","F","d","D"])? - | "." (["0"-"9"])+ ()? (["f","F","d","D"])? - | (["0"-"9"])+ (["f","F","d","D"])? - | (["0"-"9"])+ ()? ["f","F","d","D"] - > -| - < #DECIMAL_EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+ > -| - < #HEXADECIMAL_FLOATING_POINT_LITERAL: - "0" ["x", "X"] (["0"-"9","a"-"f","A"-"F"])+ (".")? (["f","F","d","D"])? - | "0" ["x", "X"] (["0"-"9","a"-"f","A"-"F"])* "." (["0"-"9","a"-"f","A"-"F"])+ (["f","F","d","D"])? - > -| - < #HEXADECIMAL_EXPONENT: ["p","P"] (["+","-"])? (["0"-"9"])+ > -| - < CHARACTER_LITERAL: - "'" - ( (~["'","\\","\n","\r"]) - | ("\\" - ( ["n","t","b","r","f","\\","'","\""] - | ["0"-"7"] ( ["0"-"7"] )? - | ["0"-"3"] ["0"-"7"] ["0"-"7"] - ) - ) - | ("\\u" - ["0"-"9","A"-"F","a"-"f"] - ["0"-"9","A"-"F","a"-"f"] - ["0"-"9","A"-"F","a"-"f"] - ["0"-"9","A"-"F","a"-"f"] - ) - ) - "'" - > -| - < STRING_LITERAL: - "\"" - ( (~["\"","\\","\n","\r"]) - | ("\\" - ( ["n","t","b","r","f","\\","'","\""] - | ["0"-"7"] ( ["0"-"7"] )? - | ["0"-"3"] ["0"-"7"] ["0"-"7"] - ) - ) - | ("\\u" - ["0"-"9","A"-"F","a"-"f"] - ["0"-"9","A"-"F","a"-"f"] - ["0"-"9","A"-"F","a"-"f"] - ["0"-"9","A"-"F","a"-"f"] - ) - )* - "\"" - > -} - -/* IDENTIFIERS */ - -TOKEN : -{ - < IDENTIFIER: ()* > -| - < #LETTER: - [ // all chars for which Character.isIdentifierStart is true - "\u0024", // "$" - "\u0041"-"\u005a", // "A"-"Z" - "\u005f", // "_" - "\u0061"-"\u007a", // "a"-"z" - "\u00a2"-"\u00a5", - "\u00aa", - "\u00b5", - "\u00ba", - "\u00c0"-"\u00d6", - "\u00d8"-"\u00f6", - "\u00f8"-"\u0236", - "\u0250"-"\u02c1", - "\u02c6"-"\u02d1", - "\u02e0"-"\u02e4", - "\u02ee", - "\u037a", - "\u0386", - "\u0388"-"\u038a", - "\u038c", - "\u038e"-"\u03a1", - "\u03a3"-"\u03ce", - "\u03d0"-"\u03f5", - "\u03f7"-"\u03fb", - "\u0400"-"\u0481", - "\u048a"-"\u04ce", - "\u04d0"-"\u04f5", - "\u04f8"-"\u04f9", - "\u0500"-"\u050f", - "\u0531"-"\u0556", - "\u0559", - "\u0561"-"\u0587", - "\u05d0"-"\u05ea", - "\u05f0"-"\u05f2", - "\u0621"-"\u063a", - "\u0640"-"\u064a", - "\u066e"-"\u066f", - "\u0671"-"\u06d3", - "\u06d5", - "\u06e5"-"\u06e6", - "\u06ee"-"\u06ef", - "\u06fa"-"\u06fc", - "\u06ff", - "\u0710", - "\u0712"-"\u072f", - "\u074d"-"\u074f", - "\u0780"-"\u07a5", - "\u07b1", - "\u0904"-"\u0939", - "\u093d", - "\u0950", - "\u0958"-"\u0961", - "\u0985"-"\u098c", - "\u098f"-"\u0990", - "\u0993"-"\u09a8", - "\u09aa"-"\u09b0", - "\u09b2", - "\u09b6"-"\u09b9", - "\u09bd", - "\u09dc"-"\u09dd", - "\u09df"-"\u09e1", - "\u09f0"-"\u09f3", - "\u0a05"-"\u0a0a", - "\u0a0f"-"\u0a10", - "\u0a13"-"\u0a28", - "\u0a2a"-"\u0a30", - "\u0a32"-"\u0a33", - "\u0a35"-"\u0a36", - "\u0a38"-"\u0a39", - "\u0a59"-"\u0a5c", - "\u0a5e", - "\u0a72"-"\u0a74", - "\u0a85"-"\u0a8d", - "\u0a8f"-"\u0a91", - "\u0a93"-"\u0aa8", - "\u0aaa"-"\u0ab0", - "\u0ab2"-"\u0ab3", - "\u0ab5"-"\u0ab9", - "\u0abd", - "\u0ad0", - "\u0ae0"-"\u0ae1", - "\u0af1", - "\u0b05"-"\u0b0c", - "\u0b0f"-"\u0b10", - "\u0b13"-"\u0b28", - "\u0b2a"-"\u0b30", - "\u0b32"-"\u0b33", - "\u0b35"-"\u0b39", - "\u0b3d", - "\u0b5c"-"\u0b5d", - "\u0b5f"-"\u0b61", - "\u0b71", - "\u0b83", - "\u0b85"-"\u0b8a", - "\u0b8e"-"\u0b90", - "\u0b92"-"\u0b95", - "\u0b99"-"\u0b9a", - "\u0b9c", - "\u0b9e"-"\u0b9f", - "\u0ba3"-"\u0ba4", - "\u0ba8"-"\u0baa", - "\u0bae"-"\u0bb5", - "\u0bb7"-"\u0bb9", - "\u0bf9", - "\u0c05"-"\u0c0c", - "\u0c0e"-"\u0c10", - "\u0c12"-"\u0c28", - "\u0c2a"-"\u0c33", - "\u0c35"-"\u0c39", - "\u0c60"-"\u0c61", - "\u0c85"-"\u0c8c", - "\u0c8e"-"\u0c90", - "\u0c92"-"\u0ca8", - "\u0caa"-"\u0cb3", - "\u0cb5"-"\u0cb9", - "\u0cbd", - "\u0cde", - "\u0ce0"-"\u0ce1", - "\u0d05"-"\u0d0c", - "\u0d0e"-"\u0d10", - "\u0d12"-"\u0d28", - "\u0d2a"-"\u0d39", - "\u0d60"-"\u0d61", - "\u0d85"-"\u0d96", - "\u0d9a"-"\u0db1", - "\u0db3"-"\u0dbb", - "\u0dbd", - "\u0dc0"-"\u0dc6", - "\u0e01"-"\u0e30", - "\u0e32"-"\u0e33", - "\u0e3f"-"\u0e46", - "\u0e81"-"\u0e82", - "\u0e84", - "\u0e87"-"\u0e88", - "\u0e8a", - "\u0e8d", - "\u0e94"-"\u0e97", - "\u0e99"-"\u0e9f", - "\u0ea1"-"\u0ea3", - "\u0ea5", - "\u0ea7", - "\u0eaa"-"\u0eab", - "\u0ead"-"\u0eb0", - "\u0eb2"-"\u0eb3", - "\u0ebd", - "\u0ec0"-"\u0ec4", - "\u0ec6", - "\u0edc"-"\u0edd", - "\u0f00", - "\u0f40"-"\u0f47", - "\u0f49"-"\u0f6a", - "\u0f88"-"\u0f8b", - "\u1000"-"\u1021", - "\u1023"-"\u1027", - "\u1029"-"\u102a", - "\u1050"-"\u1055", - "\u10a0"-"\u10c5", - "\u10d0"-"\u10f8", - "\u1100"-"\u1159", - "\u115f"-"\u11a2", - "\u11a8"-"\u11f9", - "\u1200"-"\u1206", - "\u1208"-"\u1246", - "\u1248", - "\u124a"-"\u124d", - "\u1250"-"\u1256", - "\u1258", - "\u125a"-"\u125d", - "\u1260"-"\u1286", - "\u1288", - "\u128a"-"\u128d", - "\u1290"-"\u12ae", - "\u12b0", - "\u12b2"-"\u12b5", - "\u12b8"-"\u12be", - "\u12c0", - "\u12c2"-"\u12c5", - "\u12c8"-"\u12ce", - "\u12d0"-"\u12d6", - "\u12d8"-"\u12ee", - "\u12f0"-"\u130e", - "\u1310", - "\u1312"-"\u1315", - "\u1318"-"\u131e", - "\u1320"-"\u1346", - "\u1348"-"\u135a", - "\u13a0"-"\u13f4", - "\u1401"-"\u166c", - "\u166f"-"\u1676", - "\u1681"-"\u169a", - "\u16a0"-"\u16ea", - "\u16ee"-"\u16f0", - "\u1700"-"\u170c", - "\u170e"-"\u1711", - "\u1720"-"\u1731", - "\u1740"-"\u1751", - "\u1760"-"\u176c", - "\u176e"-"\u1770", - "\u1780"-"\u17b3", - "\u17d7", - "\u17db"-"\u17dc", - "\u1820"-"\u1877", - "\u1880"-"\u18a8", - "\u1900"-"\u191c", - "\u1950"-"\u196d", - "\u1970"-"\u1974", - "\u1d00"-"\u1d6b", - "\u1e00"-"\u1e9b", - "\u1ea0"-"\u1ef9", - "\u1f00"-"\u1f15", - "\u1f18"-"\u1f1d", - "\u1f20"-"\u1f45", - "\u1f48"-"\u1f4d", - "\u1f50"-"\u1f57", - "\u1f59", - "\u1f5b", - "\u1f5d", - "\u1f5f"-"\u1f7d", - "\u1f80"-"\u1fb4", - "\u1fb6"-"\u1fbc", - "\u1fbe", - "\u1fc2"-"\u1fc4", - "\u1fc6"-"\u1fcc", - "\u1fd0"-"\u1fd3", - "\u1fd6"-"\u1fdb", - "\u1fe0"-"\u1fec", - "\u1ff2"-"\u1ff4", - "\u1ff6"-"\u1ffc", - "\u203f"-"\u2040", - "\u2054", - "\u2071", - "\u207f", - "\u20a0"-"\u20b1", - "\u2102", - "\u2107", - "\u210a"-"\u2113", - "\u2115", - "\u2119"-"\u211d", - "\u2124", - "\u2126", - "\u2128", - "\u212a"-"\u212d", - "\u212f"-"\u2131", - "\u2133"-"\u2139", - "\u213d"-"\u213f", - "\u2145"-"\u2149", - "\u2160"-"\u2183", - "\u3005"-"\u3007", - "\u3021"-"\u3029", - "\u3031"-"\u3035", - "\u3038"-"\u303c", - "\u3041"-"\u3096", - "\u309d"-"\u309f", - "\u30a1"-"\u30ff", - "\u3105"-"\u312c", - "\u3131"-"\u318e", - "\u31a0"-"\u31b7", - "\u31f0"-"\u31ff", - "\u3400"-"\u4db5", - "\u4e00"-"\u9fa5", - "\ua000"-"\ua48c", - "\uac00"-"\ud7a3", - "\ud801", //for supplementary characters suport - "\ud802", //for supplementary characters suport - "\uf900"-"\ufa2d", - "\ufa30"-"\ufa6a", - "\ufb00"-"\ufb06", - "\ufb13"-"\ufb17", - "\ufb1d", - "\ufb1f"-"\ufb28", - "\ufb2a"-"\ufb36", - "\ufb38"-"\ufb3c", - "\ufb3e", - "\ufb40"-"\ufb41", - "\ufb43"-"\ufb44", - "\ufb46"-"\ufbb1", - "\ufbd3"-"\ufd3d", - "\ufd50"-"\ufd8f", - "\ufd92"-"\ufdc7", - "\ufdf0"-"\ufdfc", - "\ufe33"-"\ufe34", - "\ufe4d"-"\ufe4f", - "\ufe69", - "\ufe70"-"\ufe74", - "\ufe76"-"\ufefc", - "\uff04", - "\uff21"-"\uff3a", - "\uff3f", - "\uff41"-"\uff5a", - "\uff65"-"\uffbe", - "\uffc2"-"\uffc7", - "\uffca"-"\uffcf", - "\uffd2"-"\uffd7", - "\uffda"-"\uffdc", - "\uffe0"-"\uffe1", - "\uffe5"-"\uffe6" - ] - > -| - < #PART_LETTER: - [ // all chars for which Character.isIdentifierPart is true - "\u0000"-"\u0008", - "\u000e"-"\u001b", - "\u0024", // "$" - "\u0030"-"\u0039", // "0"-"9" - "\u0041"-"\u005a", // "A"-"Z" - "\u005f", // "_" - "\u0061"-"\u007a", // "a"-"z" - "\u007f"-"\u009f", - "\u00a2"-"\u00a5", - "\u00aa", - "\u00ad", - "\u00b5", - "\u00ba", - "\u00c0"-"\u00d6", - "\u00d8"-"\u00f6", - "\u00f8"-"\u0236", - "\u0250"-"\u02c1", - "\u02c6"-"\u02d1", - "\u02e0"-"\u02e4", - "\u02ee", - "\u0300"-"\u0357", - "\u035d"-"\u036f", - "\u037a", - "\u0386", - "\u0388"-"\u038a", - "\u038c", - "\u038e"-"\u03a1", - "\u03a3"-"\u03ce", - "\u03d0"-"\u03f5", - "\u03f7"-"\u03fb", - "\u0400"-"\u0481", - "\u0483"-"\u0486", - "\u048a"-"\u04ce", - "\u04d0"-"\u04f5", - "\u04f8"-"\u04f9", - "\u0500"-"\u050f", - "\u0531"-"\u0556", - "\u0559", - "\u0561"-"\u0587", - "\u0591"-"\u05a1", - "\u05a3"-"\u05b9", - "\u05bb"-"\u05bd", - "\u05bf", - "\u05c1"-"\u05c2", - "\u05c4", - "\u05d0"-"\u05ea", - "\u05f0"-"\u05f2", - "\u0600"-"\u0603", - "\u0610"-"\u0615", - "\u0621"-"\u063a", - "\u0640"-"\u0658", - "\u0660"-"\u0669", - "\u066e"-"\u06d3", - "\u06d5"-"\u06dd", - "\u06df"-"\u06e8", - "\u06ea"-"\u06fc", - "\u06ff", - "\u070f"-"\u074a", - "\u074d"-"\u074f", - "\u0780"-"\u07b1", - "\u0901"-"\u0939", - "\u093c"-"\u094d", - "\u0950"-"\u0954", - "\u0958"-"\u0963", - "\u0966"-"\u096f", - "\u0981"-"\u0983", - "\u0985"-"\u098c", - "\u098f"-"\u0990", - "\u0993"-"\u09a8", - "\u09aa"-"\u09b0", - "\u09b2", - "\u09b6"-"\u09b9", - "\u09bc"-"\u09c4", - "\u09c7"-"\u09c8", - "\u09cb"-"\u09cd", - "\u09d7", - "\u09dc"-"\u09dd", - "\u09df"-"\u09e3", - "\u09e6"-"\u09f3", - "\u0a01"-"\u0a03", - "\u0a05"-"\u0a0a", - "\u0a0f"-"\u0a10", - "\u0a13"-"\u0a28", - "\u0a2a"-"\u0a30", - "\u0a32"-"\u0a33", - "\u0a35"-"\u0a36", - "\u0a38"-"\u0a39", - "\u0a3c", - "\u0a3e"-"\u0a42", - "\u0a47"-"\u0a48", - "\u0a4b"-"\u0a4d", - "\u0a59"-"\u0a5c", - "\u0a5e", - "\u0a66"-"\u0a74", - "\u0a81"-"\u0a83", - "\u0a85"-"\u0a8d", - "\u0a8f"-"\u0a91", - "\u0a93"-"\u0aa8", - "\u0aaa"-"\u0ab0", - "\u0ab2"-"\u0ab3", - "\u0ab5"-"\u0ab9", - "\u0abc"-"\u0ac5", - "\u0ac7"-"\u0ac9", - "\u0acb"-"\u0acd", - "\u0ad0", - "\u0ae0"-"\u0ae3", - "\u0ae6"-"\u0aef", - "\u0af1", - "\u0b01"-"\u0b03", - "\u0b05"-"\u0b0c", - "\u0b0f"-"\u0b10", - "\u0b13"-"\u0b28", - "\u0b2a"-"\u0b30", - "\u0b32"-"\u0b33", - "\u0b35"-"\u0b39", - "\u0b3c"-"\u0b43", - "\u0b47"-"\u0b48", - "\u0b4b"-"\u0b4d", - "\u0b56"-"\u0b57", - "\u0b5c"-"\u0b5d", - "\u0b5f"-"\u0b61", - "\u0b66"-"\u0b6f", - "\u0b71", - "\u0b82"-"\u0b83", - "\u0b85"-"\u0b8a", - "\u0b8e"-"\u0b90", - "\u0b92"-"\u0b95", - "\u0b99"-"\u0b9a", - "\u0b9c", - "\u0b9e"-"\u0b9f", - "\u0ba3"-"\u0ba4", - "\u0ba8"-"\u0baa", - "\u0bae"-"\u0bb5", - "\u0bb7"-"\u0bb9", - "\u0bbe"-"\u0bc2", - "\u0bc6"-"\u0bc8", - "\u0bca"-"\u0bcd", - "\u0bd7", - "\u0be7"-"\u0bef", - "\u0bf9", - "\u0c01"-"\u0c03", - "\u0c05"-"\u0c0c", - "\u0c0e"-"\u0c10", - "\u0c12"-"\u0c28", - "\u0c2a"-"\u0c33", - "\u0c35"-"\u0c39", - "\u0c3e"-"\u0c44", - "\u0c46"-"\u0c48", - "\u0c4a"-"\u0c4d", - "\u0c55"-"\u0c56", - "\u0c60"-"\u0c61", - "\u0c66"-"\u0c6f", - "\u0c82"-"\u0c83", - "\u0c85"-"\u0c8c", - "\u0c8e"-"\u0c90", - "\u0c92"-"\u0ca8", - "\u0caa"-"\u0cb3", - "\u0cb5"-"\u0cb9", - "\u0cbc"-"\u0cc4", - "\u0cc6"-"\u0cc8", - "\u0cca"-"\u0ccd", - "\u0cd5"-"\u0cd6", - "\u0cde", - "\u0ce0"-"\u0ce1", - "\u0ce6"-"\u0cef", - "\u0d02"-"\u0d03", - "\u0d05"-"\u0d0c", - "\u0d0e"-"\u0d10", - "\u0d12"-"\u0d28", - "\u0d2a"-"\u0d39", - "\u0d3e"-"\u0d43", - "\u0d46"-"\u0d48", - "\u0d4a"-"\u0d4d", - "\u0d57", - "\u0d60"-"\u0d61", - "\u0d66"-"\u0d6f", - "\u0d82"-"\u0d83", - "\u0d85"-"\u0d96", - "\u0d9a"-"\u0db1", - "\u0db3"-"\u0dbb", - "\u0dbd", - "\u0dc0"-"\u0dc6", - "\u0dca", - "\u0dcf"-"\u0dd4", - "\u0dd6", - "\u0dd8"-"\u0ddf", - "\u0df2"-"\u0df3", - "\u0e01"-"\u0e3a", - "\u0e3f"-"\u0e4e", - "\u0e50"-"\u0e59", - "\u0e81"-"\u0e82", - "\u0e84", - "\u0e87"-"\u0e88", - "\u0e8a", - "\u0e8d", - "\u0e94"-"\u0e97", - "\u0e99"-"\u0e9f", - "\u0ea1"-"\u0ea3", - "\u0ea5", - "\u0ea7", - "\u0eaa"-"\u0eab", - "\u0ead"-"\u0eb9", - "\u0ebb"-"\u0ebd", - "\u0ec0"-"\u0ec4", - "\u0ec6", - "\u0ec8"-"\u0ecd", - "\u0ed0"-"\u0ed9", - "\u0edc"-"\u0edd", - "\u0f00", - "\u0f18"-"\u0f19", - "\u0f20"-"\u0f29", - "\u0f35", - "\u0f37", - "\u0f39", - "\u0f3e"-"\u0f47", - "\u0f49"-"\u0f6a", - "\u0f71"-"\u0f84", - "\u0f86"-"\u0f8b", - "\u0f90"-"\u0f97", - "\u0f99"-"\u0fbc", - "\u0fc6", - "\u1000"-"\u1021", - "\u1023"-"\u1027", - "\u1029"-"\u102a", - "\u102c"-"\u1032", - "\u1036"-"\u1039", - "\u1040"-"\u1049", - "\u1050"-"\u1059", - "\u10a0"-"\u10c5", - "\u10d0"-"\u10f8", - "\u1100"-"\u1159", - "\u115f"-"\u11a2", - "\u11a8"-"\u11f9", - "\u1200"-"\u1206", - "\u1208"-"\u1246", - "\u1248", - "\u124a"-"\u124d", - "\u1250"-"\u1256", - "\u1258", - "\u125a"-"\u125d", - "\u1260"-"\u1286", - "\u1288", - "\u128a"-"\u128d", - "\u1290"-"\u12ae", - "\u12b0", - "\u12b2"-"\u12b5", - "\u12b8"-"\u12be", - "\u12c0", - "\u12c2"-"\u12c5", - "\u12c8"-"\u12ce", - "\u12d0"-"\u12d6", - "\u12d8"-"\u12ee", - "\u12f0"-"\u130e", - "\u1310", - "\u1312"-"\u1315", - "\u1318"-"\u131e", - "\u1320"-"\u1346", - "\u1348"-"\u135a", - "\u1369"-"\u1371", - "\u13a0"-"\u13f4", - "\u1401"-"\u166c", - "\u166f"-"\u1676", - "\u1681"-"\u169a", - "\u16a0"-"\u16ea", - "\u16ee"-"\u16f0", - "\u1700"-"\u170c", - "\u170e"-"\u1714", - "\u1720"-"\u1734", - "\u1740"-"\u1753", - "\u1760"-"\u176c", - "\u176e"-"\u1770", - "\u1772"-"\u1773", - "\u1780"-"\u17d3", - "\u17d7", - "\u17db"-"\u17dd", - "\u17e0"-"\u17e9", - "\u180b"-"\u180d", - "\u1810"-"\u1819", - "\u1820"-"\u1877", - "\u1880"-"\u18a9", - "\u1900"-"\u191c", - "\u1920"-"\u192b", - "\u1930"-"\u193b", - "\u1946"-"\u196d", - "\u1970"-"\u1974", - "\u1d00"-"\u1d6b", - "\u1e00"-"\u1e9b", - "\u1ea0"-"\u1ef9", - "\u1f00"-"\u1f15", - "\u1f18"-"\u1f1d", - "\u1f20"-"\u1f45", - "\u1f48"-"\u1f4d", - "\u1f50"-"\u1f57", - "\u1f59", - "\u1f5b", - "\u1f5d", - "\u1f5f"-"\u1f7d", - "\u1f80"-"\u1fb4", - "\u1fb6"-"\u1fbc", - "\u1fbe", - "\u1fc2"-"\u1fc4", - "\u1fc6"-"\u1fcc", - "\u1fd0"-"\u1fd3", - "\u1fd6"-"\u1fdb", - "\u1fe0"-"\u1fec", - "\u1ff2"-"\u1ff4", - "\u1ff6"-"\u1ffc", - "\u200c"-"\u200f", - "\u202a"-"\u202e", - "\u203f"-"\u2040", - "\u2054", - "\u2060"-"\u2063", - "\u206a"-"\u206f", - "\u2071", - "\u207f", - "\u20a0"-"\u20b1", - "\u20d0"-"\u20dc", - "\u20e1", - "\u20e5"-"\u20ea", - "\u2102", - "\u2107", - "\u210a"-"\u2113", - "\u2115", - "\u2119"-"\u211d", - "\u2124", - "\u2126", - "\u2128", - "\u212a"-"\u212d", - "\u212f"-"\u2131", - "\u2133"-"\u2139", - "\u213d"-"\u213f", - "\u2145"-"\u2149", - "\u2160"-"\u2183", - "\u3005"-"\u3007", - "\u3021"-"\u302f", - "\u3031"-"\u3035", - "\u3038"-"\u303c", - "\u3041"-"\u3096", - "\u3099"-"\u309a", - "\u309d"-"\u309f", - "\u30a1"-"\u30ff", - "\u3105"-"\u312c", - "\u3131"-"\u318e", - "\u31a0"-"\u31b7", - "\u31f0"-"\u31ff", - "\u3400"-"\u4db5", - "\u4e00"-"\u9fa5", - "\ua000"-"\ua48c", - "\uac00"-"\ud7a3", - "\ud801", //for supplementary characters suport - "\ud802", //for supplementary characters suport - "\ud834", //for supplementary characters suport - "\udc00", //for supplementary characters suport - "\udc01", //for supplementary characters suport - "\udd7b", //for supplementary characters suport - "\uf900"-"\ufa2d", - "\ufa30"-"\ufa6a", - "\ufb00"-"\ufb06", - "\ufb13"-"\ufb17", - "\ufb1d"-"\ufb28", - "\ufb2a"-"\ufb36", - "\ufb38"-"\ufb3c", - "\ufb3e", - "\ufb40"-"\ufb41", - "\ufb43"-"\ufb44", - "\ufb46"-"\ufbb1", - "\ufbd3"-"\ufd3d", - "\ufd50"-"\ufd8f", - "\ufd92"-"\ufdc7", - "\ufdf0"-"\ufdfc", - "\ufe00"-"\ufe0f", - "\ufe20"-"\ufe23", - "\ufe33"-"\ufe34", - "\ufe4d"-"\ufe4f", - "\ufe69", - "\ufe70"-"\ufe74", - "\ufe76"-"\ufefc", - "\ufeff", - "\uff04", - "\uff10"-"\uff19", - "\uff21"-"\uff3a", - "\uff3f", - "\uff41"-"\uff5a", - "\uff65"-"\uffbe", - "\uffc2"-"\uffc7", - "\uffca"-"\uffcf", - "\uffd2"-"\uffd7", - "\uffda"-"\uffdc", - "\uffe0"-"\uffe1", - "\uffe5"-"\uffe6", - "\ufff9"-"\ufffb" - ] - > -} - -/* SEPARATORS */ - -TOKEN : -{ - < LPAREN: "(" > -| < RPAREN: ")" > -| < LBRACE: "{" > -| < RBRACE: "}" > -| < LBRACKET: "[" > -| < RBRACKET: "]" > -| < SEMICOLON: ";" > -| < COMMA: "," > -| < DOT: "." > -| < AT: "@" > -} - -/* OPERATORS */ - -TOKEN : -{ - < ASSIGN: "=" > -| < LT: "<" > -| < BANG: "!" > -| < TILDE: "~" > -| < HOOK: "?" > -| < COLON: ":" > -| < EQ: "==" > -| < LE: "<=" > -| < GE: ">=" > -| < NE: "!=" > -| < SC_OR: "||" > -| < SC_AND: "&&" > -| < INCR: "++" > -| < DECR: "--" > -| < PLUS: "+" > -| < MINUS: "-" > -| < STAR: "*" > -| < SLASH: "/" > -| < BIT_AND: "&" > -| < BIT_OR: "|" > -| < XOR: "^" > -| < REM: "%" > -| < LSHIFT: "<<" > -| < PLUSASSIGN: "+=" > -| < MINUSASSIGN: "-=" > -| < STARASSIGN: "*=" > -| < SLASHASSIGN: "/=" > -| < ANDASSIGN: "&=" > -| < ORASSIGN: "|=" > -| < XORASSIGN: "^=" > -| < REMASSIGN: "%=" > -| < LSHIFTASSIGN: "<<=" > -| < RSIGNEDSHIFTASSIGN: ">>=" > -| < RUNSIGNEDSHIFTASSIGN: ">>>=" > -| < ELLIPSIS: "..." > -} - -/* >'s need special attention due to generics syntax. */ -TOKEN : -{ - < RUNSIGNEDSHIFT: ">>>" > - { - matchedToken.kind = GT; - ((ASTParser.GTToken)matchedToken).realKind = RUNSIGNEDSHIFT; - input_stream.backup(2); - } -| < RSIGNEDSHIFT: ">>" > - { - matchedToken.kind = GT; - ((ASTParser.GTToken)matchedToken).realKind = RSIGNEDSHIFT; - input_stream.backup(1); - } -| < GT: ">" > -} - - -/***************************************** - * THE JAVA LANGUAGE GRAMMAR STARTS HERE * - *****************************************/ - -IndexUnit IndexUnit(): -{ - /* Actual Type */ - List compilationUnits = new LinkedList(); - CompilationUnit cu; - - /* Parsing the compilation unit itself */ - PackageDeclaration pakage = null; - List imports = null; - ImportDeclaration in = null; - List types = null; - TypeDeclaration tn = null; - int line = -1; - int column = 0; -} -{ - [ LOOKAHEAD(PackageDeclaration()) pakage = PackageDeclaration() {line = pakage.getBeginLine(); column = pakage.getBeginColumn();} ] - ( in = ImportDeclaration() { if(line==-1){line = in.getBeginLine(); column = in.getBeginColumn();} imports = add(imports, in); } )* - ( LOOKAHEAD(TypeDeclaration()) tn = TypeDeclaration() { if(line==-1){line = tn.getBeginLine(); column = tn.getBeginColumn();} types = add(types, tn); } )* - { cu = new CompilationUnit(line == -1 ? 0 : line, column, token.endLine, token.endColumn,pakage, imports, types, getComments()); - compilationUnits.add(cu); } - -/** parse more types **/ -( - pakage = PackageDeclaration() {line = pakage.getBeginLine(); column = pakage.getBeginColumn(); imports = new LinkedList(); types = new LinkedList(); } - ( in = ImportDeclaration() { if(line==-1){line = in.getBeginLine(); column = in.getBeginColumn();} imports = add(imports, in); } )* - ( LOOKAHEAD(TypeDeclaration()) tn = TypeDeclaration() { if(line==-1){line = tn.getBeginLine(); column = tn.getBeginColumn();} types = add(types, tn); } )* - { cu = new CompilationUnit(line == -1 ? 0 : line, column, token.endLine, token.endColumn,pakage, imports, types, getComments()); - compilationUnits.add(cu); } -)* - ( | "\u001A" /** ctrl+z char **/) - { return new IndexUnit(compilationUnits); } -} - - -/* - * Program structuring syntax follows. - */ - -CompilationUnit CompilationUnit(): -{ - PackageDeclaration pakage = null; - List imports = null; - ImportDeclaration in = null; - List types = null; - TypeDeclaration tn = null; - int line = -1; - int column = 0; -} -{ - [ LOOKAHEAD(PackageDeclaration()) pakage = PackageDeclaration() {line = pakage.getBeginLine(); column = pakage.getBeginColumn();} ] - ( in = ImportDeclaration() { if(line==-1){line = in.getBeginLine(); column = in.getBeginColumn();} imports = add(imports, in); } )* - ( LOOKAHEAD(TypeDeclaration()) tn = TypeDeclaration() { if(line==-1){line = tn.getBeginLine(); column = tn.getBeginColumn();} types = add(types, tn); } )* - ( | "\u001A" /** ctrl+z char **/) - { return new CompilationUnit(line == -1 ? 0 : line, column, token.endLine, token.endColumn,pakage, imports, types, getComments()); } -} - -PackageDeclaration PackageDeclaration(): -{ - List annotations = null; - AnnotationExpr ann; - NameExpr name; - int line; - int column; -} -{ - ( ann = Annotation() { annotations = add(annotations, ann); } )* - "package" {line=token.beginLine; column=token.beginColumn;} name = Name() ";" - { return new PackageDeclaration(line, column, token.endLine, token.endColumn,annotations, name); } -} - -ImportDeclaration ImportDeclaration(): -{ - NameExpr name; - boolean isStatic = false; - boolean isAsterisk = false; - int line; - int column; -} -{ - "import" {line=token.beginLine; column=token.beginColumn;} [ "static" { isStatic = true; } ] name = Name() [ "." "*" { isAsterisk = true; } ] ";" - { return new ImportDeclaration(line, column, token.endLine, token.endColumn,name, isStatic, isAsterisk); } -} - -/* - * Modifiers. We match all modifiers in a single rule to reduce the chances of - * syntax errors for simple modifier mistakes. It will also enable us to give - * better error messages. - */ - -Modifier Modifiers(): -{ - int beginLine = -1; - int beginColumn = -1; - int modifiers = 0; - List annotations = null; - AnnotationExpr ann; -} -{ - ( - LOOKAHEAD(2) - ( - "public" { modifiers = addModifier(modifiers, ModifierSet.PUBLIC, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } - | - "static" { modifiers = addModifier(modifiers, ModifierSet.STATIC, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } - | - "protected" { modifiers = addModifier(modifiers, ModifierSet.PROTECTED, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } - | - "private" { modifiers = addModifier(modifiers, ModifierSet.PRIVATE, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } - | - "final" { modifiers = addModifier(modifiers, ModifierSet.FINAL, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } - | - "abstract" { modifiers = addModifier(modifiers, ModifierSet.ABSTRACT, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } - | - "synchronized" { modifiers = addModifier(modifiers, ModifierSet.SYNCHRONIZED, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } - | - "native" { modifiers = addModifier(modifiers, ModifierSet.NATIVE, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } - | - "transient" { modifiers = addModifier(modifiers, ModifierSet.TRANSIENT, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } - | - "volatile" { modifiers = addModifier(modifiers, ModifierSet.VOLATILE, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } - | - "strictfp" { modifiers = addModifier(modifiers, ModifierSet.STRICTFP, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } - | - ann = Annotation() { annotations = add(annotations, ann); if(beginLine==-1) {beginLine=ann.getBeginLine(); beginColumn=ann.getBeginColumn();} } - ) - )* - - { - return new Modifier(beginLine, beginColumn, modifiers, annotations); - } -} - -/* - * Declaration syntax follows. - */ -TypeDeclaration TypeDeclaration(): -{ - Modifier modifier; - TypeDeclaration ret; -} -{ - { pushJavadoc(); } - ( - ";" { ret = new EmptyTypeDeclaration(token.beginLine, token.beginColumn, token.endLine, token.endColumn, popJavadoc()); } - | - modifier = Modifiers() - ( - ret = ClassOrInterfaceDeclaration(modifier) - | - ret = EnumDeclaration(modifier) - | - ret = AnnotationTypeDeclaration(modifier) - ) - ) - { return ret; } -} - - -ClassOrInterfaceDeclaration ClassOrInterfaceDeclaration(Modifier modifier): -{ - boolean isInterface = false; - String name; - List typePar = null; - List extList = null; - List impList = null; - List members; - int line = modifier.beginLine; - int column = modifier.beginColumn; -} -{ - ( "class" | "interface" { isInterface = true; } ) { if (line == -1) {line=token.beginLine; column=token.beginColumn;} } - { name = token.image; } - [ typePar = TypeParameters() {typePar.remove(0);} ] - [ extList = ExtendsList(isInterface) ] - [ impList = ImplementsList(isInterface) ] - members = ClassOrInterfaceBody(isInterface) - - { return new ClassOrInterfaceDeclaration(line, column, token.endLine, token.endColumn,popJavadoc(), modifier.modifiers, modifier.annotations, isInterface, name, typePar, extList, impList, members); } -} - -List ExtendsList(boolean isInterface): -{ - boolean extendsMoreThanOne = false; - List ret = new LinkedList(); - ClassOrInterfaceType cit; -} -{ - "extends" cit = ClassOrInterfaceType() { ret.add(cit); } - ( "," cit = ClassOrInterfaceType() { ret.add(cit); extendsMoreThanOne = true; } )* - { - if (extendsMoreThanOne && !isInterface) - throwParseException(token, "A class cannot extend more than one other class"); - } - { return ret; } -} - -List ImplementsList(boolean isInterface): -{ - List ret = new LinkedList(); - ClassOrInterfaceType cit; -} -{ - "implements" cit = ClassOrInterfaceType() { ret.add(cit); } - ( "," cit = ClassOrInterfaceType() { ret.add(cit); } )* - { - if (isInterface) - throwParseException(token, "An interface cannot implement other interfaces"); - } - { return ret; } -} - -EnumDeclaration EnumDeclaration(Modifier modifier): -{ - String name; - List impList = null; - EnumConstantDeclaration entry; - List entries = null; - BodyDeclaration member; - List members = null; - int line = modifier.beginLine; - int column = modifier.beginColumn; -} -{ - "enum" { if (line == -1) {line=token.beginLine; column=token.beginColumn;} } - { name = token.image; } - [ impList = ImplementsList(false) ] - "{" - [ - { entries = new LinkedList(); } - entry = EnumConstantDeclaration() { entries.add(entry); } ( LOOKAHEAD(2) "," entry = EnumConstantDeclaration() { entries.add(entry); } )* - ] - [ "," ] - [ - ( ";" ( member = ClassOrInterfaceBodyDeclaration(false) { members = add(members, member); } )* ) - ] - "}" - - { return new EnumDeclaration(line, column, token.endLine, token.endColumn,popJavadoc(), modifier.modifiers, modifier.annotations, name, impList, entries, members); } -} - - -EnumConstantDeclaration EnumConstantDeclaration(): -{ - List annotations = null; - AnnotationExpr ann; - String name; - List args = null; - List classBody = null; - int line = -1; - int column = -1; -} -{ - { pushJavadoc(); } - ( ann = Annotation() { annotations = add(annotations, ann); if(line==-1){line=ann.getBeginLine(); column=ann.getBeginColumn();} } )* - { name = token.image; if(line==-1){line=token.beginLine; column=token.beginColumn;} } - [ args = Arguments() ] [ classBody = ClassOrInterfaceBody(false) ] - { return new EnumConstantDeclaration(line, column, token.endLine, token.endColumn,popJavadoc(), annotations, name, args, classBody); } -} - -List TypeParameters(): -{ - List ret = new LinkedList(); - TypeParameter tp; -} -{ - "<" { ret.add(new int[]{token.beginLine, token.beginColumn}); } - tp = TypeParameter() { ret.add(tp); } - ( "," tp = TypeParameter() { ret.add(tp); } )* - ">" - { return ret; } -} - -TypeParameter TypeParameter(): -{ - String name; - List annotations = null; - List typeBound = null; - int line; - int column; -} -{ - annotations = Annotationsopt() - { name = token.image; line=token.beginLine; column=token.beginColumn;} [ typeBound = TypeBound() ] - { return new TypeParameter(line, column, token.endLine, token.endColumn,name, annotations, typeBound); } -} - -List TypeBound(): -{ - List ret = new LinkedList(); - ClassOrInterfaceType cit; -} -{ - "extends" cit = ClassOrInterfaceType() { ret.add(cit); } - ( "&" cit = ClassOrInterfaceType() { ret.add(cit); } )* - { return ret; } -} - -List ClassOrInterfaceBody(boolean isInterface): -{ - List ret = new LinkedList(); - BodyDeclaration member; -} -{ - "{" ( member = ClassOrInterfaceBodyDeclaration(isInterface) { ret.add(member); } )* "}" - { return ret; } -} - -BodyDeclaration ClassOrInterfaceBodyDeclaration(boolean isInterface): -{ - boolean isNestedInterface = false; - Modifier modifier; - BodyDeclaration ret; -} -{ - { pushJavadoc(); } - ( - LOOKAHEAD(2) - ret = InitializerDeclaration() - { - if (isInterface) - throwParseException(token, "An interface cannot have initializers"); - } - | - modifier = Modifiers() // Just get all the modifiers out of the way. If you want to do - // more checks, pass the modifiers down to the member - ( - ret = ClassOrInterfaceDeclaration(modifier) - | - ret = EnumDeclaration(modifier) - | - ret = AnnotationTypeDeclaration(modifier) - | - LOOKAHEAD( [ TypeParameters() ] "(" ) - ret = ConstructorDeclaration(modifier) - | - LOOKAHEAD( UnType() ( "[" "]" )* ( "," | "=" | ";" ) ) - ret = FieldDeclaration(modifier) - | - ret = MethodDeclaration(modifier) - ) - | - ";" { ret = new EmptyMemberDeclaration(token.beginLine, token.beginColumn, token.endLine, token.endColumn, popJavadoc()); } - ) - { return ret; } -} - -FieldDeclaration FieldDeclaration(Modifier modifier): -{ - Type type; - List variables = new LinkedList(); - VariableDeclarator val; -} -{ - // Modifiers are already matched in the caller - type = UnType() - val = VariableDeclarator() { variables.add(val); } - ( "," val = VariableDeclarator() { variables.add(val); } )* ";" - - { - int line = modifier.beginLine; - int column = modifier.beginColumn; - if (line == -1) { line=type.getBeginLine(); column=type.getBeginColumn(); } - type.setAnnotations(modifier.annotations); - return new FieldDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), modifier.modifiers, null, type, variables); - } -} - -VariableDeclarator VariableDeclarator(): -{ - VariableDeclaratorId id; - Expression init = null; -} -{ - id = VariableDeclaratorId() [ "=" init = VariableInitializer() ] - { return new VariableDeclarator(id.getBeginLine(), id.getBeginColumn(), token.endLine, token.endColumn, id, init); } -} - -VariableDeclaratorId VariableDeclaratorId(): -{ - String name; - int arrayCount = 0; - int line; - int column; -} -{ - { name = token.image; line=token.beginLine; column=token.beginColumn;} ( "[" "]" { arrayCount++; } )* - { return new VariableDeclaratorId(line, column, token.endLine, token.endColumn,name, arrayCount); } -} - -Expression VariableInitializer(): -{ - Expression ret; -} -{ - ( - ret = ArrayInitializer() - | - ret = Expression() - ) - { return ret;} -} - -ArrayInitializerExpr ArrayInitializer(): -{ - List values = null; - Expression val; - int line; - int column; -} -{ - "{" {line=token.beginLine; column=token.beginColumn;} [ val = VariableInitializer() { values = add(values, val); } ( LOOKAHEAD(2) "," val = VariableInitializer() { values = add(values, val); } )* ] [ "," ] "}" - { return new ArrayInitializerExpr(line, column, token.endLine, token.endColumn,values); } -} - -MethodDeclaration MethodDeclaration(Modifier modifier): -{ - List typeParameters = null; - Type type; - String name; - List parameters; - int arrayCount = 0; - List annotations = null; - List receiverAnnotations = null; - List throws_ = null; - BlockStmt block = null; - int line = modifier.beginLine; - int column = modifier.beginColumn; -} -{ - // Modifiers already matched in the caller! - [ typeParameters = TypeParameters() { int[] lineCol=(int[])typeParameters.remove(0); if(line==-1){ line=lineCol[0]; column=lineCol[1];} } ] - annotations = Annotationsopt() - type = UnResultType() { if(line==-1){line=type.getBeginLine(); column=type.getBeginColumn();}} - { name = token.image; } parameters = FormalParameters() ( "[" "]" { arrayCount++; } )* - receiverAnnotations = Annotationsopt() - [ "throws" throws_ = NameList() ] - ( block = Block() | ";" ) - - { - if (annotations == null) { - annotations = modifier.annotations; - } else if (modifier.annotations != null) { - annotations.addAll(0, modifier.annotations); - } - type.setAnnotations(annotations); - return new MethodDeclaration(line, column, token.endLine, token.endColumn,popJavadoc(), modifier.modifiers, null, typeParameters, type, name, parameters, arrayCount, receiverAnnotations, throws_, block); - } -} - -List FormalParameters(): -{ - List ret = null; - Parameter par; -} -{ - "(" [ par = FormalParameter() { ret = add(ret, par); } ( "," par = FormalParameter() { ret = add(ret, par); } )* ] ")" - - { return ret; } -} - -Parameter FormalParameter(): -{ - Modifier modifier; - Type type; - boolean isVarArg = false; - List varArgAnnotations = null; - VariableDeclaratorId id; -} -{ - modifier = Modifiers() type = UnType() [ LOOKAHEAD( Annotationsopt() "..." ) varArgAnnotations = Annotationsopt() "..." { isVarArg = true;} ] id = VariableDeclaratorId() - - { - int line = modifier.beginLine; - int column = modifier.beginColumn; - if(line==-1){ line=type.getBeginLine(); column=type.getBeginColumn(); } - type.setAnnotations(modifier.annotations); - return new Parameter(line, column, token.endLine, token.endColumn, modifier.modifiers, null, type, isVarArg, id); - } -} - -ConstructorDeclaration ConstructorDeclaration(Modifier modifier): -{ - List typeParameters = null; - String name; - List parameters; - List receiverAnnotations; - List throws_ = null; - ExplicitConstructorInvocationStmt exConsInv = null; - List stmts = null; - int line = modifier.beginLine; - int column = modifier.beginColumn; - int bbLine = 0; - int bbColumn = 0; - int beLine = 0; - int beColumn = 0; -} -{ - [ typeParameters = TypeParameters() { int[] lineCol=(int[])typeParameters.remove(0); if(line==-1){ line=lineCol[0]; column=lineCol[1];} } ] - // Modifiers matched in the caller - { name = token.image; if(line==-1){line=token.beginLine; column=token.beginColumn;}} parameters = FormalParameters() - receiverAnnotations = Annotationsopt() -[ "throws" throws_ = NameList() ] -( "{" { bbLine=token.beginLine; bbColumn=token.beginColumn; } - [ LOOKAHEAD(ExplicitConstructorInvocation()) exConsInv = ExplicitConstructorInvocation() ] - stmts = Statements() - "}" | ";" ) - - { - if (exConsInv != null) { - stmts = add(0, stmts, exConsInv); - } - return new ConstructorDeclaration(line, column, token.endLine, token.endColumn,popJavadoc(), modifier.modifiers, modifier.annotations, typeParameters, name, parameters, receiverAnnotations, throws_, new BlockStmt(bbLine, bbColumn, token.endLine, token.endColumn, stmts)); - } -} - -ExplicitConstructorInvocationStmt ExplicitConstructorInvocation(): -{ - boolean isThis = false; - List args; - Expression expr = null; - List typeArgs = null; - int line = -1; - int column = 0; -} -{ - ( - LOOKAHEAD([ TypeArguments() ] "this" "(") - [ typeArgs = TypeArguments() { int[] lineCol=(int[])typeArgs.remove(0); line=lineCol[0]; column=lineCol[1]; } ] - "this" { if (line == -1) {line=token.beginLine; column=token.beginColumn;} isThis = true; } - args = Arguments() ";" - | - [ - LOOKAHEAD( PrimaryExpressionWithoutSuperSuffix() "." ) - expr = PrimaryExpressionWithoutSuperSuffix() "." - { line=expr.getBeginLine(); column=expr.getBeginColumn(); } - ] - [ typeArgs = TypeArguments() {int[] lineCol=(int[])typeArgs.remove(0); if (line == -1) {line=lineCol[0]; column=lineCol[1];}} ] - "super" {if (line == -1) {line=token.beginLine; column=token.beginColumn;}} - args = Arguments() ";" - ) - { return new ExplicitConstructorInvocationStmt(line, column, token.endLine, token.endColumn,typeArgs, isThis, expr, args); } -} - -List Statements(): -{ - List ret = null; - Statement stmt; -} -{ - ( stmt = BlockStatement() { ret = add(ret, stmt); } )* - { return ret; } -} - -InitializerDeclaration InitializerDeclaration(): -{ - BlockStmt block; - int line = -1; - int column = 0; - boolean isStatic = false; -} -{ - [ "static" { isStatic = true; line=token.beginLine; column=token.beginColumn;} ] block = Block() {if(line==-1){line=block.getBeginLine(); column=block.getBeginColumn();}} - { return new InitializerDeclaration(line, column, token.endLine, token.endColumn,popJavadoc(), isStatic, block); } -} - - -/* - * Type, name and expression syntax follows. - */ - -Type Type(): -{ - Type ret; -} -{ - ( - LOOKAHEAD(2) ret = ReferenceType() - | - ret = PrimitiveType() - ) - { return ret; } -} - -ReferenceType ReferenceType(): -{ - Type type; - int arrayCount = 0; - List annotations; - List arrayAnnotations = new LinkedList(); - List levelAnn; -} -{ - annotations = Annotationsopt() - ( - type = UnPrimitiveType() ( LOOKAHEAD( Annotationsopt() "[" ) levelAnn = Annotationsopt() "[" "]" { arrayCount++; arrayAnnotations.add(levelAnn); } )+ - | - type = UnClassOrInterfaceType() ( LOOKAHEAD( Annotationsopt() "[" ) levelAnn = Annotationsopt() "[" "]" { arrayCount++; arrayAnnotations.add(levelAnn); } )* - ) - { ReferenceType ret = new ReferenceType(type.getBeginLine(), type.getBeginColumn(), token.endLine, token.endColumn, type, arrayCount, arrayAnnotations); - ret.setAnnotations(annotations); - return ret; } -} - -ClassOrInterfaceType ClassOrInterfaceType(): -{ - ClassOrInterfaceType ret; - String name; - List typeArgs = null; - int line; - int column; - List annotations; -} -{ - annotations = Annotationsopt() - {line=token.beginLine; column=token.beginColumn;} { name = token.image; } - [ LOOKAHEAD(2) typeArgs = TypeArguments() {typeArgs.remove(0);} ] - { ret = new ClassOrInterfaceType(line, column, token.endLine, token.endColumn,null, name, typeArgs); } - ( - LOOKAHEAD(2) "." { name = token.image; } - [ LOOKAHEAD(2) typeArgs = TypeArguments() {typeArgs.remove(0);} ] { ret = new ClassOrInterfaceType(line, column, token.endLine, token.endColumn,ret, name, typeArgs); } - )* - { ret.setAnnotations(annotations); return ret; } -} - -List TypeArguments(): -{ - List ret = new LinkedList(); - Type type; -} -{ - "<" { ret.add(new int[]{token.beginLine, token.beginColumn}); } - type = TypeArgument() { ret.add(type); } ( "," type = TypeArgument() { ret.add(type); } )* - ">" - { return ret; } -} - -Type TypeArgument(): -{ - Type ret; - List annotations = new LinkedList(); -} -{ - annotations = Annotationsopt() - ( - ret = UnReferenceType() - | - ret = UnWildcard() - ) - { ret.setAnnotations(annotations); return ret; } -} - -WildcardType Wildcard(): -{ - ReferenceType ext = null; - ReferenceType sup = null; - int line; - int column; - List annotations; -} -{ - annotations = Annotationsopt() - "?" {line=token.beginLine; column=token.beginColumn;} - [ - "extends" ext = ReferenceType() - | - "super" sup = ReferenceType() - ] - { WildcardType ret = new WildcardType(line, column, token.endLine, token.endColumn,ext, sup); - ret.setAnnotations(annotations); - return ret; } -} - -PrimitiveType PrimitiveType(): -{ - PrimitiveType ret; - List annotations; -} -{ - annotations = Annotationsopt() -( - "boolean" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Boolean); } -| - "char" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Char); } -| - "byte" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Byte); } -| - "short" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Short); } -| - "int" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Int); } -| - "long" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Long); } -| - "float" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Float); } -| - "double" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Double); } -) -{ ret.setAnnotations(annotations); return ret; } -} - -Type ResultType(): -{ - Type ret; -} -{ - ( - "void" { ret = new VoidType(token.beginLine, token.beginColumn, token.endLine, token.endColumn); } - | - ret = Type() - ) - { return ret; } -} - -/* - * Unannotated Type, name and expression syntax follows. - */ - -Type UnType(): -{ - Type ret; -} -{ - ( - LOOKAHEAD(2) ret = UnReferenceType() - | - ret = UnPrimitiveType() - ) - { return ret; } -} - -ReferenceType UnReferenceType(): -{ - Type type; - int arrayCount = 0; - List arrayAnnotations = new LinkedList(); - List levelAnn; -} -{ - ( - type = UnPrimitiveType() ( LOOKAHEAD( Annotationsopt() "[" ) levelAnn = Annotationsopt() "[" "]" { arrayCount++; arrayAnnotations.add(levelAnn); } )+ - | - type = UnClassOrInterfaceType() ( LOOKAHEAD( Annotationsopt() "[" ) levelAnn = Annotationsopt() "[" "]" { arrayCount++; arrayAnnotations.add(levelAnn); } )* - ) - { return new ReferenceType(type.getBeginLine(), type.getBeginColumn(), token.endLine, token.endColumn, type, arrayCount, arrayAnnotations); } -} - -ClassOrInterfaceType UnClassOrInterfaceType(): -{ - ClassOrInterfaceType ret; - String name; - List typeArgs = null; - int line; - int column; -} -{ - {line=token.beginLine; column=token.beginColumn;} { name = token.image; } - [ LOOKAHEAD(2) typeArgs = TypeArguments() {typeArgs.remove(0);} ] - { ret = new ClassOrInterfaceType(line, column, token.endLine, token.endColumn,null, name, typeArgs); } - ( - LOOKAHEAD(2) "." { name = token.image; } - [ LOOKAHEAD(2) typeArgs = TypeArguments() {typeArgs.remove(0);} ] { ret = new ClassOrInterfaceType(line, column, token.endLine, token.endColumn,ret, name, typeArgs); } - )* - { return ret; } -} - -PrimitiveType UnPrimitiveType(): -{ - PrimitiveType ret; -} -{ -( - "boolean" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Boolean); } -| - "char" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Char); } -| - "byte" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Byte); } -| - "short" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Short); } -| - "int" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Int); } -| - "long" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Long); } -| - "float" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Float); } -| - "double" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Double); } -) -{ return ret; } -} - -WildcardType UnWildcard(): -{ - ReferenceType ext = null; - ReferenceType sup = null; - int line; - int column; -} -{ - "?" {line=token.beginLine; column=token.beginColumn;} - [ - "extends" ext = ReferenceType() - | - "super" sup = ReferenceType() - ] - { return new WildcardType(line, column, token.endLine, token.endColumn,ext, sup); } -} - -Type UnResultType(): -{ - Type ret; -} -{ - ( - "void" { ret = new VoidType(token.beginLine, token.beginColumn, token.endLine, token.endColumn); } - | - ret = UnType() - ) - { return ret; } -} - -NameExpr Name(): -/* - * A lookahead of 2 is required below since "Name" can be followed - * by a ".*" when used in the context of an "ImportDeclaration". - */ -{ - NameExpr ret; -} -{ - { ret = new NameExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); } - ( LOOKAHEAD(2) "." { ret = new QualifiedNameExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, token.image); } )* - { return ret; } -} - -List NameList(): -{ - List ret = new LinkedList(); - NameExpr name; -} -{ - name = Name() { ret.add(name); } ( "," name = Name() { ret.add(name); } )* - - { return ret; } -} - - -/* - * Expression syntax follows. - */ - -Expression Expression(): -/* - * This expansion has been written this way instead of: - * Assignment() | ConditionalExpression() - * for performance reasons. - * However, it is a weakening of the grammar for it allows the LHS of - * assignments to be any conditional expression whereas it can only be - * a primary expression. Consider adding a semantic predicate to work - * around this. - */ -{ - Expression ret; - AssignExpr.Operator op; - Expression value; -} -{ - ret = ConditionalExpression() - [ - LOOKAHEAD(2) - op = AssignmentOperator() value = Expression() { ret = new AssignExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, value, op); } - ] - { return ret; } -} - -AssignExpr.Operator AssignmentOperator(): -{ - AssignExpr.Operator ret; -} -{ - ( - "=" { ret = AssignExpr.Operator.assign; } - | "*=" { ret = AssignExpr.Operator.star; } - | "/=" { ret = AssignExpr.Operator.slash; } - | "%=" { ret = AssignExpr.Operator.rem; } - | "+=" { ret = AssignExpr.Operator.plus; } - | "-=" { ret = AssignExpr.Operator.minus; } - | "<<=" { ret = AssignExpr.Operator.lShift; } - | ">>=" { ret = AssignExpr.Operator.rSignedShift; } - | ">>>=" { ret = AssignExpr.Operator.rUnsignedShift; } - | "&=" { ret = AssignExpr.Operator.and; } - | "^=" { ret = AssignExpr.Operator.xor; } - | "|=" { ret = AssignExpr.Operator.or; } - ) - { return ret; } -} - -Expression ConditionalExpression(): -{ - Expression ret; - Expression left; - Expression right; -} -{ - ret = ConditionalOrExpression() - [ "?" left = Expression() ":" right = ConditionalExpression() { ret = new ConditionalExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, left, right); } ] - { return ret; } -} - -Expression ConditionalOrExpression(): -{ - Expression ret; - Expression right; -} -{ - ret = ConditionalAndExpression() ( "||" right = ConditionalAndExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.or); } )* - { return ret; } -} - -Expression ConditionalAndExpression(): -{ - Expression ret; - Expression right; -} -{ - ret = InclusiveOrExpression() ( "&&" right = InclusiveOrExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.and); } )* - { return ret; } -} - -Expression InclusiveOrExpression(): -{ - Expression ret; - Expression right; -} -{ - ret = ExclusiveOrExpression() ( "|" right = ExclusiveOrExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.binOr); } )* - { return ret; } -} - -Expression ExclusiveOrExpression(): -{ - Expression ret; - Expression right; -} -{ - ret = AndExpression() ( "^" right = AndExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.xor); } )* - { return ret; } -} - -Expression AndExpression(): -{ - Expression ret; - Expression right; -} -{ - ret = EqualityExpression() ( "&" right = EqualityExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.binAnd); } )* - { return ret; } -} - -Expression EqualityExpression(): -{ - Expression ret; - Expression right; - BinaryExpr.Operator op; -} -{ - ret = InstanceOfExpression() - ( - ( "==" { op = BinaryExpr.Operator.equals; } | - "!=" { op = BinaryExpr.Operator.notEquals; } - ) right = InstanceOfExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); } - )* - { return ret; } -} - -Expression InstanceOfExpression(): -{ - Expression ret; - Type type; -} -{ - ret = RelationalExpression() [ "instanceof" type = Type() { ret = new InstanceOfExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, type); } ] - { return ret; } -} - -Expression RelationalExpression(): -{ - Expression ret; - Expression right; - BinaryExpr.Operator op; -} -{ - ret = ShiftExpression() - ( - ( "<" { op = BinaryExpr.Operator.less; } | - ">" { op = BinaryExpr.Operator.greater; } | - "<=" { op = BinaryExpr.Operator.lessEquals; } | - ">=" { op = BinaryExpr.Operator.greaterEquals; } - ) right = ShiftExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); } - )* - { return ret; } -} - -Expression ShiftExpression(): -{ - Expression ret; - Expression right; - BinaryExpr.Operator op; -} -{ - ret = AdditiveExpression() - ( - ( "<<" { op = BinaryExpr.Operator.lShift; } | - RSIGNEDSHIFT() { op = BinaryExpr.Operator.rSignedShift; } | - RUNSIGNEDSHIFT() { op = BinaryExpr.Operator.rUnsignedShift; } - ) right = AdditiveExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); } - )* - { return ret; } -} - -Expression AdditiveExpression(): -{ - Expression ret; - Expression right; - BinaryExpr.Operator op; -} -{ - ret = MultiplicativeExpression() - ( - ( "+" { op = BinaryExpr.Operator.plus; } | - "-" { op = BinaryExpr.Operator.minus; } - ) right = MultiplicativeExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); } - )* - { return ret; } -} - -Expression MultiplicativeExpression(): -{ - Expression ret; - Expression right; - BinaryExpr.Operator op; -} -{ - ret = UnaryExpression() - ( - ( "*" { op = BinaryExpr.Operator.times; } | - "/" { op = BinaryExpr.Operator.divide; } | - "%" { op = BinaryExpr.Operator.remainder; } - ) right = UnaryExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); } - )* - { return ret; } -} - -Expression UnaryExpression(): -{ - Expression ret; - UnaryExpr.Operator op; - int line = 0; - int column = 0; -} -{ - ( - ret = PreIncrementExpression() - | - ret = PreDecrementExpression() - | - ( "+" { op = UnaryExpr.Operator.positive; line=token.beginLine; column=token.beginColumn;} | - "-" { op = UnaryExpr.Operator.negative; line=token.beginLine; column=token.beginColumn;} - ) ret = UnaryExpression() - { - if(op == UnaryExpr.Operator.negative) { - if (ret instanceof IntegerLiteralExpr && ((IntegerLiteralExpr)ret).isMinValue()) { - ret = new IntegerLiteralMinValueExpr(line, column, token.endLine, token.endColumn); - } else if (ret instanceof LongLiteralExpr && ((LongLiteralExpr)ret).isMinValue()) { - ret = new LongLiteralMinValueExpr(line, column, token.endLine, token.endColumn); - } else { - ret = new UnaryExpr(line, column, token.endLine, token.endColumn,ret, op); - } - } else { - ret = new UnaryExpr(line, column, token.endLine, token.endColumn,ret, op); - } - } - | - ret = UnaryExpressionNotPlusMinus() - ) - { return ret; } -} - -Expression PreIncrementExpression(): -{ - Expression ret; - int line; - int column; -} -{ - "++" {line=token.beginLine; column=token.beginColumn;} ret = UnaryExpression() { ret = new UnaryExpr(line, column, token.endLine, token.endColumn,ret, UnaryExpr.Operator.preIncrement); } - { return ret; } -} - -Expression PreDecrementExpression(): -{ - Expression ret; - int line; - int column; -} -{ - "--" {line=token.beginLine; column=token.beginColumn;} ret = UnaryExpression() { ret = new UnaryExpr(line, column, token.endLine, token.endColumn,ret, UnaryExpr.Operator.preDecrement); } - { return ret; } -} - -Expression UnaryExpressionNotPlusMinus(): -{ - Expression ret; - UnaryExpr.Operator op; - int line = 0; - int column = 0; -} -{ - ( - ( "~" { op = UnaryExpr.Operator.inverse; line=token.beginLine; column=token.beginColumn;} | - "!" { op = UnaryExpr.Operator.not; line=token.beginLine; column=token.beginColumn;} - ) ret = UnaryExpression() { ret = new UnaryExpr(line, column, token.endLine, token.endColumn,ret, op); } - | - LOOKAHEAD( CastExpression() ) - ret = CastExpression() - | - ret = PostfixExpression() - ) - { return ret; } -} - -Expression PostfixExpression(): -{ - Expression ret; - UnaryExpr.Operator op; -} -{ - ret = PrimaryExpression() - [ - LOOKAHEAD(2) - ( "++" { op = UnaryExpr.Operator.posIncrement; } | - "--" { op = UnaryExpr.Operator.posDecrement; } - ) { ret = new UnaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, op); } - ] - { return ret; } -} - -Expression CastExpression(): -{ - Expression ret; - Type type; - int line; - int column; -} -{ - "(" {line=token.beginLine; column=token.beginColumn;} - ( - LOOKAHEAD(2) - type = PrimitiveType() ")" ret = UnaryExpression() { ret = new CastExpr(line, column, token.endLine, token.endColumn,type, ret); } - | - type = ReferenceType() ")" ret = UnaryExpressionNotPlusMinus() { ret = new CastExpr(line, column, token.endLine, token.endColumn,type, ret); } - ) - { return ret; } -} - -Expression PrimaryExpression(): -{ - Expression ret; - Expression inner; -} -{ - ret = PrimaryPrefix() ( LOOKAHEAD(2) ret = PrimarySuffix(ret) )* - { return ret; } -} - -Expression PrimaryExpressionWithoutSuperSuffix(): -{ - Expression ret; - Expression inner; -} -{ - ret = PrimaryPrefix() ( LOOKAHEAD( PrimarySuffixWithoutSuper(null) ) ret = PrimarySuffixWithoutSuper(ret) )* - { return ret; } -} - -Expression PrimaryPrefix(): -{ - Expression ret; - String name; - List typeArgs = null; - List args = null; - boolean hasArgs = false; - Type type; - int line; - int column; -} -{ - ( - ret = Literal() - | - "this" { ret = new ThisExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, null); } - | - "super" { ret = new SuperExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, null); } - "." - [ typeArgs = TypeArguments() {typeArgs.remove(0);} ] - { name = token.image; } - [ args = Arguments() {hasArgs=true;} ] - { - ret = hasArgs - ? new MethodCallExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, typeArgs, name, args) - : new FieldAccessExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, null, name); - } - | - "(" {line=token.beginLine; column=token.beginColumn;} ret = Expression() ")" { ret = new EnclosedExpr(line, column, token.endLine, token.endColumn,ret); } - | - ret = AllocationExpression(null) - | - LOOKAHEAD( UnResultType() "." "class" ) - type = UnResultType() "." "class" { ret = new ClassExpr(type.getBeginLine(), type.getBeginColumn(), token.endLine, token.endColumn, type); } - | - { name = token.image; line=token.beginLine; column=token.beginColumn; } - [ args = Arguments() {hasArgs=true;} ] - { - ret = hasArgs - ? new MethodCallExpr(line, column, token.endLine, token.endColumn, null, null, name, args) - : new NameExpr(line, column, token.endLine, token.endColumn, name); - } - ) - { return ret; } -} - -Expression PrimarySuffix(Expression scope): -{ - Expression ret; -} -{ - ( - LOOKAHEAD(2) - ret = PrimarySuffixWithoutSuper(scope) - | - "." "super" { ret = new SuperExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope); } - ) - { return ret; } -} - -Expression PrimarySuffixWithoutSuper(Expression scope): -{ - Expression ret; - List typeArgs = null; - List args = null; - boolean hasArgs = false; - String name; -} -{ - ( - "." - ( - // TODO: está deixando passar "this.this", verificar na JLS se é possível - "this" { ret = new ThisExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope); } - | - ret = AllocationExpression(scope) - | - LOOKAHEAD( [ TypeArguments() ] ) - [ typeArgs = TypeArguments() {typeArgs.remove(0);} ] - { name = token.image; } - [ args = Arguments() {hasArgs=true;} ] - { - ret = hasArgs - ? new MethodCallExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope, typeArgs, name, args) - : new FieldAccessExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope, typeArgs, name); - } - ) - | - "["ret = Expression() "]" { ret = new ArrayAccessExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope, ret); } - ) - { return ret; } -} - -Expression Literal(): -{ - Expression ret; -} -{ - ( - { - ret = new IntegerLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); - } - | - { - ret = new LongLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); - } - | - { - ret = new DoubleLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); - } - | - { - ret = new CharLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image.substring(1, token.image.length()-1)); - } - | - { - ret = new StringLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image.substring(1, token.image.length()-1)); - } - | - ret = BooleanLiteral() - | - ret = NullLiteral() - ) - { return ret; } -} - -Expression BooleanLiteral(): -{ - Expression ret; -} -{ - ( - "true" { ret = new BooleanLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, true); } - | - "false" { ret = new BooleanLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, false); } - ) - { return ret; } -} - -Expression NullLiteral(): -{} -{ - "null" - { return new NullLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn); } -} - -List Arguments(): -{ - List ret = null; -} -{ - "(" [ ret = ArgumentList() ] ")" - { return ret; } -} - -List ArgumentList(): -{ - List ret = new LinkedList(); - Expression expr; -} -{ - expr = Expression() { ret.add(expr); } ( "," expr = Expression() { ret.add(expr); } )* - { return ret; } -} - -Expression AllocationExpression(Expression scope): -{ - Expression ret; - Type type; - Object[] arr = null; - List typeArgs = null; - List anonymousBody = null; - List args; - int line; - int column; -} -{ - "new" { if(scope==null) {line=token.beginLine; column=token.beginColumn;} else {line=scope.getBeginLine(); column=scope.getBeginColumn();} } - ( - type = UnPrimitiveType() arr = ArrayDimsAndInits() - { - if (arr[0] instanceof Integer) { - ret = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, ((Integer)arr[0]).intValue(), (ArrayInitializerExpr)arr[1]); - } else { - ret = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, (List)arr[0], ((Integer)arr[1]).intValue()); - } - } - | - [ typeArgs = TypeArguments() {typeArgs.remove(0);} ] - type = UnClassOrInterfaceType() - ( - arr = ArrayDimsAndInits() - { - if (arr[0] instanceof Integer) { - ret = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, ((Integer)arr[0]).intValue(), (ArrayInitializerExpr)arr[1]); - } else { - ret = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, (List)arr[0], ((Integer)arr[1]).intValue()); - } - } - | - args = Arguments() [ LOOKAHEAD(2) anonymousBody = ClassOrInterfaceBody(false) ] - { ret = new ObjectCreationExpr(line, column, token.endLine, token.endColumn, scope, (ClassOrInterfaceType) type, typeArgs, args, anonymousBody); } - ) - ) - { return ret; } -} - -/* - * The third LOOKAHEAD specification below is to parse to PrimarySuffix - * if there is an expression between the "[...]". - */ -Object[] ArrayDimsAndInits(): -{ - Object[] ret = new Object[2]; - Expression expr; - List inits = null; - int i = 0; -} -{ - ( - LOOKAHEAD(2) - ( LOOKAHEAD(2) "[" expr = Expression() { inits = add(inits, expr); } "]" )+ ( LOOKAHEAD(2) "[" "]" { i++; } )* { ret[0] = inits; ret[1] = new Integer(i); } - | - ( "[" "]" { i++; } )+ expr = ArrayInitializer() { ret[0] = new Integer(i); ret[1] = expr; } - ) - { return ret; } -} - - -/* - * Statement syntax follows. - */ - -Statement Statement(): -{ - Statement ret; -} -{ - ( - LOOKAHEAD(2) - ret = LabeledStatement() - | - ret = AssertStatement() - | - ret = Block() - | - ret = EmptyStatement() - | - ret = StatementExpression() - | - ret = SwitchStatement() - | - ret = IfStatement() - | - ret = WhileStatement() - | - ret = DoStatement() - | - ret = ForStatement() - | - ret = BreakStatement() - | - ret = ContinueStatement() - | - ret = ReturnStatement() - | - ret = ThrowStatement() - | - ret = SynchronizedStatement() - | - ret = TryStatement() - ) - { return ret; } -} - -AssertStmt AssertStatement(): -{ - Expression check; - Expression msg = null; - int line; - int column; -} -{ - "assert" {line=token.beginLine; column=token.beginColumn;} check = Expression() [ ":" msg = Expression() ] ";" - { return new AssertStmt(line, column, token.endLine, token.endColumn,check, msg); } -} - -LabeledStmt LabeledStatement(): -{ - String label; - Statement stmt; - int line; - int column; -} -{ - {line=token.beginLine; column=token.beginColumn;} { label = token.image; } ":" stmt = Statement() - { return new LabeledStmt(line, column, token.endLine, token.endColumn,label, stmt); } -} - -BlockStmt Block(): -{ - List stmts; - int beginLine; - int beginColumn; -} -{ - "{" {beginLine=token.beginLine; beginColumn=token.beginColumn;} - stmts = Statements() - "}" - { return new BlockStmt(beginLine, beginColumn, token.endLine, token.endColumn, stmts); } -} - -/* - * Classes inside block stametents can only be abstract or final. The semantic must check it. - */ -Statement BlockStatement(): -{ - Statement ret; - Expression expr; - ClassOrInterfaceDeclaration typeDecl; - Modifier modifier; -} -{ - ( - LOOKAHEAD( Modifiers() ("class" | "interface") ) - { pushJavadoc(); } - modifier = Modifiers() - typeDecl = ClassOrInterfaceDeclaration(modifier) { ret = new TypeDeclarationStmt(typeDecl.getBeginLine(), typeDecl.getBeginColumn(), token.endLine, token.endColumn, typeDecl); } - | - LOOKAHEAD(VariableDeclarationExpression() ) - expr = VariableDeclarationExpression() ";" - { ret = new ExpressionStmt(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr); } - | - ret = Statement() - ) - { return ret; } -} - -VariableDeclarationExpr VariableDeclarationExpression(): -{ - Modifier modifier; - Type type; - List vars = new LinkedList(); - VariableDeclarator var; -} -{ - modifier = Modifiers() type = UnType() var = VariableDeclarator() { vars.add(var); } ( "," var = VariableDeclarator() { vars.add(var); } )* - { - int line = modifier.beginLine; - int column = modifier.beginColumn; - if(line==-1) {line=type.getBeginLine(); column=type.getBeginColumn(); } - type.setAnnotations(modifier.annotations); - return new VariableDeclarationExpr(line, column, token.endLine, token.endColumn, modifier.modifiers, null, type, vars); - } -} - -EmptyStmt EmptyStatement(): -{} -{ - ";" - { return new EmptyStmt(token.beginLine, token.beginColumn, token.endLine, token.endColumn); } -} - -ExpressionStmt StatementExpression(): -/* - * The last expansion of this production accepts more than the legal - * Java expansions for StatementExpression. This expansion does not - * use PostfixExpression for performance reasons. - */ -{ - Expression expr; - AssignExpr.Operator op; - Expression value; -} -{ - ( - expr = PreIncrementExpression() - | - expr = PreDecrementExpression() - | - expr = PrimaryExpression() - [ - "++" { expr = new UnaryExpr(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr, UnaryExpr.Operator.posIncrement); } - | - "--" { expr = new UnaryExpr(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr, UnaryExpr.Operator.posDecrement); } - | - op = AssignmentOperator() value = Expression() { expr = new AssignExpr(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr, value, op); } - ] - ) - ";" - { return new ExpressionStmt(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr); } -} - -SwitchStmt SwitchStatement(): -{ - Expression selector; - SwitchEntryStmt entry; - List entries = null; - int line; - int column; -} -{ - "switch" {line=token.beginLine; column=token.beginColumn;} "(" selector = Expression() ")" "{" - ( entry = SwitchEntry() { entries = add(entries, entry); } )* - "}" - - { return new SwitchStmt(line, column, token.endLine, token.endColumn,selector, entries); } -} - -SwitchEntryStmt SwitchEntry(): -{ - Expression label = null; - List stmts; - int line; - int column; -} -{ - ( - "case" {line=token.beginLine; column=token.beginColumn;} label = Expression() - | - "default" {line=token.beginLine; column=token.beginColumn;} - ) - ":" stmts = Statements() - - { return new SwitchEntryStmt(line, column, token.endLine, token.endColumn,label, stmts); } -} - -IfStmt IfStatement(): -/* - * The disambiguating algorithm of JavaCC automatically binds dangling - * else's to the innermost if statement. The LOOKAHEAD specification - * is to tell JavaCC that we know what we are doing. - */ -{ - Expression condition; - Statement thenStmt; - Statement elseStmt = null; - int line; - int column; -} -{ - "if" {line=token.beginLine; column=token.beginColumn;} "(" condition = Expression() ")" thenStmt = Statement() [ LOOKAHEAD(1) "else" elseStmt = Statement() ] - { return new IfStmt(line, column, token.endLine, token.endColumn,condition, thenStmt, elseStmt); } -} - -WhileStmt WhileStatement(): -{ - Expression condition; - Statement body; - int line; - int column; -} -{ - "while" {line=token.beginLine; column=token.beginColumn;} "(" condition = Expression() ")" body = Statement() - { return new WhileStmt(line, column, token.endLine, token.endColumn,condition, body); } -} - -DoStmt DoStatement(): -{ - Expression condition; - Statement body; - int line; - int column; -} -{ - "do" {line=token.beginLine; column=token.beginColumn;} body = Statement() "while" "(" condition = Expression() ")" ";" - { return new DoStmt(line, column, token.endLine, token.endColumn,body, condition); } -} - -Statement ForStatement(): -{ - String id = null; - VariableDeclarationExpr varExpr = null; - Expression expr = null; - List init = null; - List update = null; - Statement body; - int line; - int column; -} -{ - "for" {line=token.beginLine; column=token.beginColumn;} "(" - - ( - LOOKAHEAD(VariableDeclarationExpression() ":") - varExpr = VariableDeclarationExpression() ":" expr = Expression() - | - [ init = ForInit() ] ";" [ expr = Expression() ] ";" [ update = ForUpdate() ] - ) - - ")" body = Statement() - - { - if (varExpr != null) { - return new ForeachStmt(line, column, token.endLine, token.endColumn,varExpr, expr, body); - } - return new ForStmt(line, column, token.endLine, token.endColumn,init, expr, update, body); - } -} - -List ForInit(): -{ - List ret; - Expression expr; -} -{ - ( - LOOKAHEAD( Modifiers() UnType() ) - expr = VariableDeclarationExpression() { ret = new LinkedList(); ret.add(expr); } - | - ret = ExpressionList() - ) - { return ret; } -} - -List ExpressionList(): -{ - List ret = new LinkedList(); - Expression expr; -} -{ - expr = Expression() { ret.add(expr); } ( "," expr = Expression() { ret.add(expr); } )* - - { return ret; } -} - -List ForUpdate(): -{ - List ret; -} -{ - ret = ExpressionList() - - { return ret; } -} - -BreakStmt BreakStatement(): -{ - String id = null; - int line; - int column; -} -{ - "break" {line=token.beginLine; column=token.beginColumn;} [ { id = token.image; } ] ";" - { return new BreakStmt(line, column, token.endLine, token.endColumn,id); } -} - -ContinueStmt ContinueStatement(): -{ - String id = null; - int line; - int column; -} -{ - "continue" {line=token.beginLine; column=token.beginColumn;} [ { id = token.image; } ] ";" - { return new ContinueStmt(line, column, token.endLine, token.endColumn,id); } -} - -ReturnStmt ReturnStatement(): -{ - Expression expr = null; - int line; - int column; -} -{ - "return" {line=token.beginLine; column=token.beginColumn;} [ expr = Expression() ] ";" - { return new ReturnStmt(line, column, token.endLine, token.endColumn,expr); } -} - -ThrowStmt ThrowStatement(): -{ - Expression expr; - int line; - int column; -} -{ - "throw" {line=token.beginLine; column=token.beginColumn;} expr = Expression() ";" - { return new ThrowStmt(line, column, token.endLine, token.endColumn,expr); } -} - -SynchronizedStmt SynchronizedStatement(): -{ - Expression expr; - BlockStmt block; - int line; - int column; -} -{ - "synchronized" {line=token.beginLine; column=token.beginColumn;} "(" expr = Expression() ")" block = Block() - { return new SynchronizedStmt(line, column, token.endLine, token.endColumn,expr, block); } -} - -TryStmt TryStatement(): -/* - * Semantic check required here to make sure that at least one - * finally/catch is present. - */ -{ - BlockStmt tryBlock; - BlockStmt finallyBlock = null; - List catchs = null; - Parameter except; - BlockStmt catchBlock; - int line; - int column; - int cLine; - int cColumn; -} -{ - "try" {line=token.beginLine; column=token.beginColumn;} tryBlock = Block() - ( - ( - "catch" {cLine=token.beginLine; cColumn=token.beginColumn;} - "(" except = FormalParameter() ")" catchBlock = Block() - { catchs = add(catchs, new CatchClause(cLine, cColumn, token.endLine, token.endColumn, except, catchBlock)); } - )+ - [ "finally" finallyBlock = Block() ] - | - "finally" finallyBlock = Block() - ) - { return new TryStmt(line, column, token.endLine, token.endColumn,tryBlock, catchs, finallyBlock); } -} - - - -/* We use productions to match >>>, >> and > so that we can keep the - * type declaration syntax with generics clean - */ - -void RUNSIGNEDSHIFT(): -{} -{ - ( LOOKAHEAD({ getToken(1).kind == GT && - ((GTToken)getToken(1)).realKind == RUNSIGNEDSHIFT} ) - ">" ">" ">" - ) -} - -void RSIGNEDSHIFT(): -{} -{ - ( LOOKAHEAD({ getToken(1).kind == GT && - ((GTToken)getToken(1)).realKind == RSIGNEDSHIFT} ) - ">" ">" - ) -} - -/* Annotation syntax follows. */ - -List Annotationsopt(): -{ - List annotations = new LinkedList(); - AnnotationExpr ann; -} -{ - ( - (ann = Annotation() { annotations.add(ann); })* - ) - { return annotations; } -} - -AnnotationExpr Annotation(): -{ - AnnotationExpr ret; -} -{ - ( - LOOKAHEAD( "@" Name() "(" ( "=" | ")" )) - ret = NormalAnnotation() - | - LOOKAHEAD( "@" Name() "(" ) - ret = SingleMemberAnnotation() - | - ret = MarkerAnnotation() - ) - { return ret; } -} - -NormalAnnotationExpr NormalAnnotation(): -{ - NameExpr name; - List pairs = null; - int line; - int column; -} -{ - "@" {line=token.beginLine; column=token.beginColumn;} name = Name() "(" [ pairs = MemberValuePairs() ] ")" - { return new NormalAnnotationExpr(line, column, token.endLine, token.endColumn,name, pairs); } -} - -MarkerAnnotationExpr MarkerAnnotation(): -{ - NameExpr name; - int line; - int column; -} -{ - "@" {line=token.beginLine; column=token.beginColumn;} name = Name() - { return new MarkerAnnotationExpr(line, column, token.endLine, token.endColumn,name); } -} - -SingleMemberAnnotationExpr SingleMemberAnnotation(): -{ - NameExpr name; - Expression memberVal; - int line; - int column; -} -{ - "@" {line=token.beginLine; column=token.beginColumn;} name = Name() "(" memberVal = MemberValue() ")" - { return new SingleMemberAnnotationExpr(line, column, token.endLine, token.endColumn,name, memberVal); } -} - -List MemberValuePairs(): -{ - List ret = new LinkedList(); - MemberValuePair pair; -} -{ - pair = MemberValuePair() { ret.add(pair); } ( "," pair = MemberValuePair() { ret.add(pair); } )* - { return ret; } -} - -MemberValuePair MemberValuePair(): -{ - String name; - Expression value; - int line; - int column; -} -{ - { name = token.image; line=token.beginLine; column=token.beginColumn;} "=" value = MemberValue() - { return new MemberValuePair(line, column, token.endLine, token.endColumn,name, value); } -} - -Expression MemberValue(): -{ - Expression ret; -} -{ - ( - ret = Annotation() - | - ret = MemberValueArrayInitializer() - | - ret = ConditionalExpression() - ) - { return ret; } -} - -Expression MemberValueArrayInitializer(): -{ - List ret = new LinkedList(); - Expression member; - int line; - int column; -} -{ - "{" {line=token.beginLine; column=token.beginColumn;} - ( member = MemberValue() { ret.add(member); } ( LOOKAHEAD(2) "," member = MemberValue() { ret.add(member); } )* )? [ "," ] - "}" - { return new ArrayInitializerExpr(line, column, token.endLine, token.endColumn,ret); } -} - - -/* Annotation Types. */ - -AnnotationDeclaration AnnotationTypeDeclaration(Modifier modifier): -{ - String name; - List members; - int line = modifier.beginLine; - int column = modifier.beginColumn; -} -{ - "@" { if (line == -1) {line=token.beginLine; column=token.beginColumn;} } - "interface" { name = token.image; } members = AnnotationTypeBody() - - { return new AnnotationDeclaration(line, column, token.endLine, token.endColumn,popJavadoc(), modifier.modifiers, modifier.annotations, name, members); } -} - -List AnnotationTypeBody(): -{ - List ret = null; - BodyDeclaration member; -} -{ - "{" ( member = AnnotationBodyDeclaration() { ret = add(ret, member); } )* "}" - - { return ret; } -} - -BodyDeclaration AnnotationBodyDeclaration(): -{ - Modifier modifier; - BodyDeclaration ret; -} -{ - { pushJavadoc(); } - ( - ";" { ret = new EmptyTypeDeclaration(token.beginLine, token.beginColumn, token.endLine, token.endColumn, popJavadoc()); } - | - modifier = Modifiers() - ( - LOOKAHEAD(Type() "(") - ret = AnnotationTypeMemberDeclaration(modifier) - | - ret = ClassOrInterfaceDeclaration(modifier) - | - ret = EnumDeclaration(modifier) - | - ret = AnnotationTypeDeclaration(modifier) - | - ret = FieldDeclaration(modifier) - ) - ) - { return ret; } -} - -AnnotationMemberDeclaration AnnotationTypeMemberDeclaration(Modifier modifier): -{ - Type type; - String name; - Expression defaultVal = null; -} -{ - type = Type() { name = token.image; } "(" ")" [ defaultVal = DefaultValue() ] ";" - - { - int line = modifier.beginLine; - int column = modifier.beginColumn; - { if (line == -1) {line=type.getBeginLine(); column=type.getBeginColumn();} } - return new AnnotationMemberDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), modifier.modifiers, modifier.annotations, type, name, defaultVal); - } -} - -Expression DefaultValue(): -{ - Expression ret; -} -{ - "default" ret = MemberValue() - { return ret; } -} diff --git a/stubparser/test/japa/parser/ast/test/AllTests.java b/stubparser/test/japa/parser/ast/test/AllTests.java deleted file mode 100644 index c937035d361..00000000000 --- a/stubparser/test/japa/parser/ast/test/AllTests.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Created on 11/01/2009 - */ -package org.checkerframework.stubparser.ast.test; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -/** - * @author Julio Vilmar Gesser - */ -@RunWith(value = Suite.class) -@SuiteClasses(value = {// -TestAdapters.class, // - TestNodePositions.class, // - TestDumper.class, // - TestHashCodeEquals.class }) -public class AllTests { - -} diff --git a/stubparser/test/japa/parser/ast/test/Helper.java b/stubparser/test/japa/parser/ast/test/Helper.java deleted file mode 100644 index c2a460810a9..00000000000 --- a/stubparser/test/japa/parser/ast/test/Helper.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Created on 30/06/2008 - */ -package org.checkerframework.stubparser.ast.test; - -import org.checkerframework.stubparser.JavaParser; -import org.checkerframework.stubparser.ParseException; -import org.checkerframework.stubparser.ast.CompilationUnit; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.StringBufferInputStream; - -/** - * @author Julio Vilmar Gesser - */ -final class Helper { - - private Helper() { - // hide the constructor - } - - private static File getFile(String sourceFolder, Class clazz) { - return new File(sourceFolder, clazz.getName().replace('.', '/') + ".java"); - } - - public static CompilationUnit parserClass(String sourceFolder, Class clazz) throws ParseException { - try { - return JavaParser.parse(getFile(sourceFolder, clazz)); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - public static CompilationUnit parserString(String source) throws ParseException { - return JavaParser.parse(new StringBufferInputStream(source)); - } - - public static String readFile(File file) throws IOException { - BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file))); - try { - StringBuilder ret = new StringBuilder(); - String line; - while ((line = reader.readLine()) != null) { - ret.append(line); - ret.append("\n"); - } - return ret.toString(); - } finally { - reader.close(); - } - } - - public static String readClass(String sourceFolder, Class clazz) throws IOException { - return readFile(getFile(sourceFolder, clazz)); - } - -} diff --git a/stubparser/test/japa/parser/ast/test/TestAdapters.java b/stubparser/test/japa/parser/ast/test/TestAdapters.java deleted file mode 100644 index 36161325da3..00000000000 --- a/stubparser/test/japa/parser/ast/test/TestAdapters.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (C) 2008 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 11/06/2008 - */ -package org.checkerframework.stubparser.ast.test; - -import org.checkerframework.stubparser.ParseException; -import org.checkerframework.stubparser.ast.CompilationUnit; -import org.checkerframework.stubparser.ast.test.classes.DumperTestClass; -import org.checkerframework.stubparser.ast.test.classes.JavadocTestClass; -import org.checkerframework.stubparser.ast.visitor.GenericVisitor; -import org.checkerframework.stubparser.ast.visitor.GenericVisitorAdapter; -import org.checkerframework.stubparser.ast.visitor.ModifierVisitorAdapter; -import org.checkerframework.stubparser.ast.visitor.VoidVisitor; -import org.checkerframework.stubparser.ast.visitor.VoidVisitorAdapter; - -import org.junit.Test; - -/** - * @author Julio Vilmar Gesser - */ -public class TestAdapters { - - static class ConcreteVoidVisitorAdapter extends VoidVisitorAdapter { - - } - - static class ConcreteGenericVisitorAdapter extends GenericVisitorAdapter { - - } - - static class ConcreteModifierVisitorAdapter extends ModifierVisitorAdapter { - - } - - private void doTest(VoidVisitor< ? > visitor) throws ParseException { - CompilationUnit cu = Helper.parserClass("./test", DumperTestClass.class); - cu.accept(visitor, null); - - cu = Helper.parserClass("./test", JavadocTestClass.class); - cu.accept(visitor, null); - } - - private void doTest(GenericVisitor< ? , ? > visitor) throws ParseException { - CompilationUnit cu = Helper.parserClass("./test", DumperTestClass.class); - cu.accept(visitor, null); - - cu = Helper.parserClass("./test", JavadocTestClass.class); - cu.accept(visitor, null); - } - - @Test - public void testVoidVisitorAdapter() throws Exception { - doTest(new ConcreteVoidVisitorAdapter()); - } - - @Test - public void testGenericVisitorAdapter() throws Exception { - doTest(new ConcreteGenericVisitorAdapter()); - } - - @Test - public void testModifierVisitorAdapter() throws Exception { - doTest(new ConcreteModifierVisitorAdapter()); - } - -} diff --git a/stubparser/test/japa/parser/ast/test/TestDumper.java b/stubparser/test/japa/parser/ast/test/TestDumper.java deleted file mode 100644 index 830db103854..00000000000 --- a/stubparser/test/japa/parser/ast/test/TestDumper.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 22/11/2006 - */ -package org.checkerframework.stubparser.ast.test; - -import static org.junit.Assert.assertEquals; -import org.checkerframework.stubparser.ast.CompilationUnit; -import org.checkerframework.stubparser.ast.test.classes.DumperTestClass; -import org.checkerframework.stubparser.ast.test.classes.JavadocTestClass; - -import org.junit.Test; - -/** - * @author Julio Vilmar Gesser - */ -public class TestDumper { - - @Test - public void testDumpVisitor() throws Exception { - String source = Helper.readClass("./test", DumperTestClass.class); - CompilationUnit cu = Helper.parserString(source); - assertEquals(source, cu.toString()); - } - - @Test - public void testJavadoc() throws Exception { - String source = Helper.readClass("./test", JavadocTestClass.class); - CompilationUnit cu = Helper.parserString(source); - assertEquals(source, cu.toString()); - assertEquals(19, cu.getComments().size()); - } - - @Test - public void testComments() throws Exception { - final String source_with_comment = // - "package org.checkerframework.stubparser.javacc;\n" + // - "public class Teste {\n" + // - "// line comment\n" + // - "int a = 0;" + // - "// line comment\r\n" + // - "int b = 0;" + // - "// line comment\r" + // - "int c = 0;" + // - "/* multi-line\n comment\n*/" + // - "int d = 0;" + // - "/** multi-line\r\n javadoc\n*/" + // - "int e = 0;" + // - "}\n" + // - "// final comment" + // - ""; - final String source_without_comment = // - "package org.checkerframework.stubparser.javacc;\n" + // - "\n" + // - "public class Teste {\n" + // - "\n" + // - " int a = 0;\n" + // - "\n" + // - " int b = 0;\n" + // - "\n" + // - " int c = 0;\n" + // - "\n" + // - " int d = 0;\n" + // - "\n" + // - " /** multi-line\r\n javadoc\n*/\n" + // - " int e = 0;\n" + // - "}\n" + // - ""; - - CompilationUnit cu = Helper.parserString(source_with_comment); - assertEquals(source_without_comment, cu.toString()); - assertEquals(6, cu.getComments().size()); - } -} diff --git a/stubparser/test/japa/parser/ast/test/TestHashCodeEquals.java b/stubparser/test/japa/parser/ast/test/TestHashCodeEquals.java deleted file mode 100644 index 99a1901adf4..00000000000 --- a/stubparser/test/japa/parser/ast/test/TestHashCodeEquals.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 22/11/2006 - */ -package org.checkerframework.stubparser.ast.test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import org.checkerframework.stubparser.ast.CompilationUnit; -import org.checkerframework.stubparser.ast.PackageDeclaration; -import org.checkerframework.stubparser.ast.expr.NameExpr; -import org.checkerframework.stubparser.ast.test.classes.DumperTestClass; -import org.checkerframework.stubparser.ast.test.classes.JavadocTestClass; - -import org.junit.Test; - -/** - * @author Julio Vilmar Gesser - */ -public class TestHashCodeEquals { - - private void assertEqualsAndHashCode(Object o1, Object o2) { - assertEquals(o1, o2); - assertEquals(o1.hashCode(), o2.hashCode()); - } - - private void assertNotEqualsAndHashCode(Object o1, Object o2) { - assertFalse("Not different equals", o1.equals(o2)); - assertFalse("Not different hashCode", o1.hashCode() == o2.hashCode()); - } - - private void assertNotEquals(Object o1, Object o2) { - assertFalse("Not different equals", o1.equals(o2)); - } - - @Test - public void tesCompilationUnitEqual() throws Exception { - String source = Helper.readClass("./test", DumperTestClass.class); - CompilationUnit cu1 = Helper.parserString(source); - CompilationUnit cu2 = Helper.parserString(source); - assertEqualsAndHashCode(cu1, cu2); - } - - @Test - public void tesCompilationUnitNotEqual() throws Exception { - String source = Helper.readClass("./test", DumperTestClass.class); - CompilationUnit cu1 = Helper.parserString(source); - CompilationUnit cu2 = Helper.parserString(source); - - cu2.setPackage(new PackageDeclaration(new NameExpr("diff_package"))); - assertNotEqualsAndHashCode(cu1, cu2); - } - - @Test - public void testDiffClasses() throws Exception { - final String source_with_comment = // - "package org.checkerframework.stubparser.javacc; " + // - "public class Teste {}"; - final String source_without_comment = // - "package org.checkerframework.stubparser.javacc; " + // - "public enum Teste {}"; - - CompilationUnit cu1 = Helper.parserString(source_with_comment); - CompilationUnit cu2 = Helper.parserString(source_without_comment); - - assertNotEqualsAndHashCode(cu1, cu2); - } - - @Test - public void testJavadoc() throws Exception { - String source = Helper.readClass("./test", JavadocTestClass.class); - CompilationUnit cu1 = Helper.parserString(source); - CompilationUnit cu2 = Helper.parserString(source); - assertEqualsAndHashCode(cu1, cu2); - } - - private final String source_with_comment = // - "package org.checkerframework.stubparser.javacc;\n" + // - "public class Teste {\n" + // - "// line comment\n" + // - "int a = 0;" + // - "// line comment\r\n" + // - "int b = 0;" + // - "// line comment\r" + // - "int c = 0;" + // - "/* multi-line\n comment\n*/" + // - "int d = 0;" + // - "/** multi-line\r\n javadoc\n*/" + // - "int e = 0;" + // - "}\n" + // - "// final comment" + // - ""; - - private final String source_without_comment = // - "package org.checkerframework.stubparser.javacc;\n" + // - "\n" + // - "public class Teste {\n" + // - "\n" + // - " int a = 0;\n" + // - "\n" + // - " int b = 0;\n" + // - "\n" + // - " int c = 0;\n" + // - "\n" + // - " int d = 0;\n" + // - "\n" + // - " /** multi-line\r\n javadoc\n*/\n" + // - " int e = 0;\n" + // - "}\n" + // - ""; - - @Test - public void testCommentsDiff() throws Exception { - - CompilationUnit cu1 = Helper.parserString(source_with_comment); - CompilationUnit cu2 = Helper.parserString(source_without_comment); - - // hashcode can be the same, equals() shall return false - assertNotEquals(cu1, cu2); - } - - @Test - public void testCommentsEquals() throws Exception { - - CompilationUnit cu1 = Helper.parserString(source_with_comment); - CompilationUnit cu2 = Helper.parserString(source_with_comment); - - assertEqualsAndHashCode(cu1, cu2); - } -} diff --git a/stubparser/test/japa/parser/ast/test/TestNodePositions.java b/stubparser/test/japa/parser/ast/test/TestNodePositions.java deleted file mode 100644 index c37705ae23f..00000000000 --- a/stubparser/test/japa/parser/ast/test/TestNodePositions.java +++ /dev/null @@ -1,643 +0,0 @@ -/* - * Created on 30/06/2008 - */ -package org.checkerframework.stubparser.ast.test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import org.checkerframework.stubparser.ast.BlockComment; -import org.checkerframework.stubparser.ast.CompilationUnit; -import org.checkerframework.stubparser.ast.ImportDeclaration; -import org.checkerframework.stubparser.ast.LineComment; -import org.checkerframework.stubparser.ast.Node; -import org.checkerframework.stubparser.ast.PackageDeclaration; -import org.checkerframework.stubparser.ast.TypeParameter; -import org.checkerframework.stubparser.ast.body.AnnotationDeclaration; -import org.checkerframework.stubparser.ast.body.AnnotationMemberDeclaration; -import org.checkerframework.stubparser.ast.body.ClassOrInterfaceDeclaration; -import org.checkerframework.stubparser.ast.body.ConstructorDeclaration; -import org.checkerframework.stubparser.ast.body.EmptyMemberDeclaration; -import org.checkerframework.stubparser.ast.body.EmptyTypeDeclaration; -import org.checkerframework.stubparser.ast.body.EnumConstantDeclaration; -import org.checkerframework.stubparser.ast.body.EnumDeclaration; -import org.checkerframework.stubparser.ast.body.FieldDeclaration; -import org.checkerframework.stubparser.ast.body.InitializerDeclaration; -import org.checkerframework.stubparser.ast.body.JavadocComment; -import org.checkerframework.stubparser.ast.body.MethodDeclaration; -import org.checkerframework.stubparser.ast.body.Parameter; -import org.checkerframework.stubparser.ast.body.VariableDeclarator; -import org.checkerframework.stubparser.ast.body.VariableDeclaratorId; -import org.checkerframework.stubparser.ast.expr.ArrayAccessExpr; -import org.checkerframework.stubparser.ast.expr.ArrayCreationExpr; -import org.checkerframework.stubparser.ast.expr.ArrayInitializerExpr; -import org.checkerframework.stubparser.ast.expr.AssignExpr; -import org.checkerframework.stubparser.ast.expr.BinaryExpr; -import org.checkerframework.stubparser.ast.expr.BooleanLiteralExpr; -import org.checkerframework.stubparser.ast.expr.CastExpr; -import org.checkerframework.stubparser.ast.expr.CharLiteralExpr; -import org.checkerframework.stubparser.ast.expr.ClassExpr; -import org.checkerframework.stubparser.ast.expr.ConditionalExpr; -import org.checkerframework.stubparser.ast.expr.DoubleLiteralExpr; -import org.checkerframework.stubparser.ast.expr.EnclosedExpr; -import org.checkerframework.stubparser.ast.expr.FieldAccessExpr; -import org.checkerframework.stubparser.ast.expr.InstanceOfExpr; -import org.checkerframework.stubparser.ast.expr.IntegerLiteralExpr; -import org.checkerframework.stubparser.ast.expr.IntegerLiteralMinValueExpr; -import org.checkerframework.stubparser.ast.expr.LongLiteralExpr; -import org.checkerframework.stubparser.ast.expr.LongLiteralMinValueExpr; -import org.checkerframework.stubparser.ast.expr.MarkerAnnotationExpr; -import org.checkerframework.stubparser.ast.expr.MemberValuePair; -import org.checkerframework.stubparser.ast.expr.MethodCallExpr; -import org.checkerframework.stubparser.ast.expr.NameExpr; -import org.checkerframework.stubparser.ast.expr.NormalAnnotationExpr; -import org.checkerframework.stubparser.ast.expr.NullLiteralExpr; -import org.checkerframework.stubparser.ast.expr.ObjectCreationExpr; -import org.checkerframework.stubparser.ast.expr.QualifiedNameExpr; -import org.checkerframework.stubparser.ast.expr.SingleMemberAnnotationExpr; -import org.checkerframework.stubparser.ast.expr.StringLiteralExpr; -import org.checkerframework.stubparser.ast.expr.SuperExpr; -import org.checkerframework.stubparser.ast.expr.ThisExpr; -import org.checkerframework.stubparser.ast.expr.UnaryExpr; -import org.checkerframework.stubparser.ast.expr.VariableDeclarationExpr; -import org.checkerframework.stubparser.ast.stmt.AssertStmt; -import org.checkerframework.stubparser.ast.stmt.BlockStmt; -import org.checkerframework.stubparser.ast.stmt.BreakStmt; -import org.checkerframework.stubparser.ast.stmt.CatchClause; -import org.checkerframework.stubparser.ast.stmt.ContinueStmt; -import org.checkerframework.stubparser.ast.stmt.DoStmt; -import org.checkerframework.stubparser.ast.stmt.EmptyStmt; -import org.checkerframework.stubparser.ast.stmt.ExplicitConstructorInvocationStmt; -import org.checkerframework.stubparser.ast.stmt.ExpressionStmt; -import org.checkerframework.stubparser.ast.stmt.ForStmt; -import org.checkerframework.stubparser.ast.stmt.ForeachStmt; -import org.checkerframework.stubparser.ast.stmt.IfStmt; -import org.checkerframework.stubparser.ast.stmt.LabeledStmt; -import org.checkerframework.stubparser.ast.stmt.ReturnStmt; -import org.checkerframework.stubparser.ast.stmt.SwitchEntryStmt; -import org.checkerframework.stubparser.ast.stmt.SwitchStmt; -import org.checkerframework.stubparser.ast.stmt.SynchronizedStmt; -import org.checkerframework.stubparser.ast.stmt.ThrowStmt; -import org.checkerframework.stubparser.ast.stmt.TryStmt; -import org.checkerframework.stubparser.ast.stmt.TypeDeclarationStmt; -import org.checkerframework.stubparser.ast.stmt.WhileStmt; -import org.checkerframework.stubparser.ast.test.classes.DumperTestClass; -import org.checkerframework.stubparser.ast.type.ClassOrInterfaceType; -import org.checkerframework.stubparser.ast.type.PrimitiveType; -import org.checkerframework.stubparser.ast.type.ReferenceType; -import org.checkerframework.stubparser.ast.type.VoidType; -import org.checkerframework.stubparser.ast.type.WildcardType; -import org.checkerframework.stubparser.ast.visitor.VoidVisitorAdapter; - -import org.junit.Test; - -/** - * @author Julio Vilmar Gesser - */ -public class TestNodePositions { - - @Test - public void testNodePositions() throws Exception { - String source = Helper.readClass("./test", DumperTestClass.class); - CompilationUnit cu = Helper.parserString(source); - - cu.accept(new TestVisitor(source), null); - } - - void doTest(String source, Node node) { - String parsed = node.toString(); - - assertTrue(node.getClass().getName() + ": " + parsed, node.getBeginLine() >= 0); - assertTrue(node.getClass().getName() + ": " + parsed, node.getBeginColumn() >= 0); - assertTrue(node.getClass().getName() + ": " + parsed, node.getEndLine() >= 0); - assertTrue(node.getClass().getName() + ": " + parsed, node.getEndColumn() >= 0); - - if (node.getBeginLine() == node.getEndLine()) { - assertTrue(node.getClass().getName() + ": " + parsed, node.getBeginColumn() <= node.getEndColumn()); - } else { - assertTrue(node.getClass().getName() + ": " + parsed, node.getBeginLine() <= node.getEndLine()); - } - - String substr = substring(source, node.getBeginLine(), node.getBeginColumn(), node.getEndLine(), node.getEndColumn()); - assertEquals(node.getClass().getName(), trimLines(parsed), trimLines(substr)); - } - - private String trimLines(String str) { - String[] split = str.split("\n"); - StringBuilder ret = new StringBuilder(); - for (int i = 0; i < split.length; i++) { - ret.append(split[i].trim()); - if (i < split.length - 1) { - ret.append("\n"); - } - } - - return ret.toString(); - } - - private String substring(String source, int beginLine, int beginColumn, int endLine, int endColumn) { - int pos = 0; - while (beginLine > 1) { - if (source.charAt(pos) == '\n') { - beginLine--; - endLine--; - } - pos++; - } - int start = pos + beginColumn - 1; - - while (endLine > 1) { - if (source.charAt(pos) == '\n') { - endLine--; - } - pos++; - } - int end = pos + endColumn; - - return source.substring(start, end); - } - - class TestVisitor extends VoidVisitorAdapter { - - private final String source; - - public TestVisitor(String source) { - this.source = source; - } - - @Override - public void visit(AnnotationDeclaration n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(AnnotationMemberDeclaration n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(ArrayAccessExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(ArrayCreationExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(ArrayInitializerExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(AssertStmt n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(AssignExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(BinaryExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(BlockComment n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(BlockStmt n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(BooleanLiteralExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(BreakStmt n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(CastExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(CatchClause n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(CharLiteralExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(ClassExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(ClassOrInterfaceDeclaration n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(ClassOrInterfaceType n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(CompilationUnit n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(ConditionalExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(ConstructorDeclaration n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(ContinueStmt n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(DoStmt n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(DoubleLiteralExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(EmptyMemberDeclaration n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(EmptyStmt n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(EmptyTypeDeclaration n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(EnclosedExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(EnumConstantDeclaration n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(EnumDeclaration n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(ExplicitConstructorInvocationStmt n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(ExpressionStmt n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(FieldAccessExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(FieldDeclaration n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(ForeachStmt n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(ForStmt n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(IfStmt n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(ImportDeclaration n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(InitializerDeclaration n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(InstanceOfExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(IntegerLiteralExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(IntegerLiteralMinValueExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(JavadocComment n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(LabeledStmt n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(LineComment n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(LongLiteralExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(LongLiteralMinValueExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(MarkerAnnotationExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(MemberValuePair n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(MethodCallExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(MethodDeclaration n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(NameExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(NormalAnnotationExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(NullLiteralExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(ObjectCreationExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(PackageDeclaration n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(Parameter n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(PrimitiveType n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(QualifiedNameExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(ReferenceType n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(ReturnStmt n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(SingleMemberAnnotationExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(StringLiteralExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(SuperExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(SwitchEntryStmt n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(SwitchStmt n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(SynchronizedStmt n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(ThisExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(ThrowStmt n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(TryStmt n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(TypeDeclarationStmt n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(TypeParameter n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(UnaryExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(VariableDeclarationExpr n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(VariableDeclarator n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(VariableDeclaratorId n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(VoidType n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(WhileStmt n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - @Override - public void visit(WildcardType n, Object arg) { - doTest(source, n); - super.visit(n, arg); - } - - } - -} diff --git a/stubparser/test/japa/parser/ast/test/classes/DumperTestClass.java b/stubparser/test/japa/parser/ast/test/classes/DumperTestClass.java deleted file mode 100644 index 4cced7b7334..00000000000 --- a/stubparser/test/japa/parser/ast/test/classes/DumperTestClass.java +++ /dev/null @@ -1,380 +0,0 @@ -package org.checkerframework.stubparser.ast.test.classes; - -import org.checkerframework.stubparser.JavaParser; -import org.checkerframework.stubparser.ParseException; -import org.checkerframework.stubparser.ast.CompilationUnit; -import java.io.File; -import java.io.IOException; -import java.io.Serializable; -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Target; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.List; -import java.util.Map; -import static java.util.Map.Entry; -import java.applet.*; - -@Deprecated -public class DumperTestClass, X> extends Base implements Serializable { - - static Class clz1 = String.class; - - protected Class clz2 = (String.class); - - Class clz3 = int.class; - - Class clz4 = (int.class); - - int[] arr = new int[10]; - - byte bye = 0; - - byte byebye[] = null; - - short sh1, sh2 = 1; - - List[][] arrLS = (List[][]) new List[10][]; - - ; - - { - int z = 0, y = 0; - int a = (z) + y; - a = (+z) + y; - byte b = (byte) +y; - } - - @Deprecated() - static class Ugly { - - static int x = 0; - - public static void main(String[] args) { - x = +x; - x = ~x; - --x; - boolean b = !false; - x &= 2; - x |= 2; - x ^= 2; - x -= 2; - x %= 2; - x /= 2; - x *= 2; - x <<= 2; - x >>= 2; - x >>>= 2; - b = b || false; - b = b | false; - b = b & false; - b = b ^ false; - b = b != false; - b = x > 1; - b = x < 1; - b = x >= 1; - b = x <= 1; - x = x << 1; - x = x >> 1; - x = x >>> 1; - x = x - 1; - x = x * 1; - x = x % 1; - x = x / 1; - } - } - - ; - - @Deprecated() - int[][][][] arr2 = new int[10][2][1][0]; - - volatile float fff = 0x1.fffeP+127f; - - char cc = 'a'; - - int[][] arr3 = { { 1, 2 }, { 3, 4 } }; - - static int[] arr4[] = {}; - - public static DumperTestClass t; - - static { - arr4 = new int[][] { { 2 }, { 1 } }; - } - - { - arr3 = new int[][] { { 2 }, { 1 } }; - } - - public enum Teste { - - asc, def - } - - public static enum Sexo { - - m, @Deprecated - f; - - public static enum Sexo_ implements Serializable, Cloneable { - } - - private Sexo() { - } - } - - @Deprecated - public static enum Enum { - - m(1) { - - @Override - void mm() { - } - } - , f(2) { - - void mm() { - } - } - ; - - native void nnn(); - - transient int x; - - private Enum(int x) { - this.x = x; - } - - abstract void mm(); - } - - strictfp double ddd() { - return 0.0; - } - - public DumperTestClass(int x) { - this.arr[0] = x; - T val1 = null; - E val2 = null; - super.check2(val1, val2); - boolean b = true, y = false; - abstract class X { - - int i = 0; - - public X() { - } - - public void m() { - } - } - @Deprecated - final class Y extends X { - - public Y() { - super(); - DumperTestClass.this.cc = 'c'; - super.i = 1; - Y.super.m(); - } - - public Y(int y) { - t.super(); - } - - public Y(long x) { - this(); - } - } - } - - public DumperTestClass(String str) { - } - - private class QWE extends DumperTestClass, String> { - - @Deprecated - final int z = 0; - - int i = (int) -1; - - public QWE(String... x) { - super(x[0]); - } - - public QWE(int... x) { - super(x[0]); - i = x[0]; - assert true; - assert 1 == 1 : 2; - { - int iii = 3; - iii += 3; - } - label: { - int iii = 1; - } - ; - ; - int min = -2147483648; - long sl = 123123123123l; - long minl = -9223372036854775808L; - switch(i) { - } - ll: switch(i) { - case 1: - System.out.println(1); - break ll; - default: - { - System.out.println("default"); - break; - } - case 2: - if (t instanceof Base) { - System.out.println(1); - } - i++; - ++i; - } - } - - private synchronized int doSomething()[] { - List x = new ArrayList(); - return new int[] { 1 }; - } - } - - public static void main(String[] args) throws ParseException, IOException { - int x = 2; - CompilationUnit cu = parse(new File("src/japa/parser/javacc/Parser.java")); - System.out.println(cu); - DumperTestClass teste = new DumperTestClass(2); - DumperTestClass.QWE qwe = teste.new QWE(1); - if (1 + 1 == 2) { - teste = null; - teste = new DumperTestClass(1); - } else { - x = 3; - teste = new DumperTestClass(1); - x = x == 0 ? 2 : 4; - } - if (true) x = 1; else x = 3; - while (true) { - xxx: while (x == 3) continue xxx; - break; - } - do { - x++; - } while (x < 100); - do x++; while (x < 100); - for (@Deprecated int i : arr4[0]) { - x--; - } - for (@Deprecated final int i = 0, j = 1; i < 10; x++) { - break; - } - int i, j; - for (i = 0, j = 1; i < 10 && j < 2; i++, j--) { - break; - } - } - - @AnnotationTest(value = "x") - public static CompilationUnit parse(@Deprecated File file) throws ParseException, IOException { - String a = ((String) "qwe"); - String x = ((String) clz1.getName()); - int y = ((Integer) (Object) x).intValue(); - synchronized (file) { - file = null; - file = new File(""); - } - try { - if (file == null) { - throw new NullPointerException("blah"); - } - } catch (final NullPointerException e) { - System.out.println("catch"); - } catch (RuntimeException e) { - System.out.println("catch"); - } finally { - System.out.println("finally"); - } - try { - if (file == null) { - throw new NullPointerException("blah"); - } - } finally { - System.out.println("finally"); - } - try { - if (file == null) { - throw new NullPointerException("blah"); - } - } catch (RuntimeException e) { - System.out.println("catch"); - } - return JavaParser.parse(file); - } - - class A implements XXX, Serializable { - - @AnnotationTest - public <@TypeAnnotationTest ABC> A(Integer integer, ABC string) throws Exception, IOException { - } - } - - private void x(Map x) { - @Deprecated Comparator c = new Comparator() { - - public int compare(Object o1, Object o2) { - try { - A a = new A(new Integer(11), "foo") { - }; - } catch (Exception e) { - } - return 0; - } - - @Override - public boolean equals(Object obj) { - return super.equals(obj); - } - }; - } - - @Documented - public @interface AnnotationTest { - - String value() default "asd"; - - @Deprecated - int[] valueI() default { 1, 2 }; - - AnnotationTest valueA1() default @AnnotationTest; - - AnnotationTest valueA2() default @AnnotationTest("qwe"); - - AnnotationTest valueA3() default @AnnotationTest(value = "qwe", valueI = { 1 }); - } - - @Documented - @Target({ElementType.TYPE_USE}) - public @interface TypeAnnotationTest { - } - - ; -} - -class Base { - - public void check2(A val1, B val2) { - } -} - -interface XXX extends Serializable, Cloneable { -} diff --git a/stubparser/test/japa/parser/ast/test/classes/JavadocTestClass.java b/stubparser/test/japa/parser/ast/test/classes/JavadocTestClass.java deleted file mode 100644 index 41e6e3e1015..00000000000 --- a/stubparser/test/japa/parser/ast/test/classes/JavadocTestClass.java +++ /dev/null @@ -1,127 +0,0 @@ -package org.checkerframework.stubparser.ast.test.classes; - -/** - * Javadoc 1 - * @author Julio Vilmar Gesser - */ -public abstract class JavadocTestClass { - - ; - - /** - * 1.1 - */ - ; - - private static int x; - - /** - * 1.2 - */ - private int y[]; - - /** - * 1.3 - */ - @Annotation(x = 10) - private int z; - - private static final int m(int x) { - return 0; - } - - /** - * 1.4 - * @param x - * @return - */ - private static final int m2(int x) { - x = 10; - /** - * 1.4.1 - * @author jgesser - */ - class Teste { - - /** - * 1.4.1.1 - */ - int x; - } - return 0; - } - - /** - * 1.5 - */ - public JavadocTestClass() { - } - - /** - * 1.5 - */ - public JavadocTestClass(int x) { - } - - /** - * 1.6 - * init - */ - { - z = 10; - } - - /** - * 1.6 - * init - */ - static { - x = 10; - } -} - -/** - * Javadoc 2 - */ -@Deprecated -@SuppressWarnings(value = "") -abstract class Class2 { -} - -/** - * Javadoc 3 - */ -; - -/** - * Javadoc 4 - */ -enum Enum { - - /** - * 4.1 - */ - item1, item2, item3, /** - * 4.2 - */ - item4 -} - -/** - * Javadoc 5 - */ -@interface Annotation { - - ; - - /** - * Javadoc 5.1 - * @return - */ - int x(); - - /** - * Javadoc 5.2 - */ - ; -}