Kaynağa Gözat

Remove outdated java frontends, rename Java 9+ frontend "java-1.9" to "java".

Timur Sağlam 4 yıl önce
ebeveyn
işleme
8bc7525646
66 değiştirilmiş dosya ile 13 ekleme ve 9588 silme
  1. 0 110
      jplag.frontend.java-1.1exp/pom.xml
  2. 0 130
      jplag.frontend.java-1.1exp/src/main/java/de/jplag/javax/JavaToken.java
  3. 0 102
      jplag.frontend.java-1.1exp/src/main/java/de/jplag/javax/JavaTokenConstants.java
  4. 0 77
      jplag.frontend.java-1.1exp/src/main/java/de/jplag/javax/Language.java
  5. 0 37
      jplag.frontend.java-1.1exp/src/main/java/de/jplag/javax/Parser.java
  6. 0 1186
      jplag.frontend.java-1.1exp/src/main/javacc/Java1.1.jj
  7. 0 39
      jplag.frontend.java-1.2/Readme.txt
  8. 0 82
      jplag.frontend.java-1.2/pom.xml
  9. 0 1272
      jplag.frontend.java-1.2/src/main/antlr/java.g
  10. 0 96
      jplag.frontend.java-1.2/src/main/java/de/jplag/java/JavaToken.java
  11. 0 55
      jplag.frontend.java-1.2/src/main/java/de/jplag/java/JavaTokenConstants.java
  12. 0 76
      jplag.frontend.java-1.2/src/main/java/de/jplag/java/Language.java
  13. 0 68
      jplag.frontend.java-1.2/src/main/java/de/jplag/java/Parser.java
  14. 0 6
      jplag.frontend.java-1.5/.gitignore
  15. 0 77
      jplag.frontend.java-1.5/pom.xml
  16. 0 95
      jplag.frontend.java-1.5/src/main/java/de/jplag/java15/JavaToken.java
  17. 0 74
      jplag.frontend.java-1.5/src/main/java/de/jplag/java15/JavaTokenConstants.java
  18. 0 76
      jplag.frontend.java-1.5/src/main/java/de/jplag/java15/Language.java
  19. 0 82
      jplag.frontend.java-1.5/src/main/java/de/jplag/java15/LanguageWithDelimitedMethods.java
  20. 0 51
      jplag.frontend.java-1.5/src/main/java/de/jplag/java15/Parser.java
  21. 0 496
      jplag.frontend.java-1.5/src/main/java/de/jplag/java15/grammar/JavaTabModCharStream.java
  22. 0 91
      jplag.frontend.java-1.5/src/main/java/de/jplag/java15/grammar/Token.java
  23. 0 1557
      jplag.frontend.java-1.5/src/main/javacc/Java1.5.jj
  24. 0 87
      jplag.frontend.java-1.7/pom.xml
  25. 0 765
      jplag.frontend.java-1.7/src/main/antlr4/de/jplag/java17/grammar/Java7.g4
  26. 0 174
      jplag.frontend.java-1.7/src/main/java/de/jplag/java17/JavaToken.java
  27. 0 78
      jplag.frontend.java-1.7/src/main/java/de/jplag/java17/JavaTokenConstants.java
  28. 0 1462
      jplag.frontend.java-1.7/src/main/java/de/jplag/java17/JplagJava7Listener.java
  29. 0 76
      jplag.frontend.java-1.7/src/main/java/de/jplag/java17/Language.java
  30. 0 80
      jplag.frontend.java-1.7/src/main/java/de/jplag/java17/Parser.java
  31. 0 22
      jplag.frontend.java-1.7/src/test/java/de/jplag/StrippedProgram.java
  32. 0 80
      jplag.frontend.java-1.7/src/test/java/de/jplag/antlr4Learning/Antlr4LearningTests.java
  33. 0 45
      jplag.frontend.java-1.7/src/test/java/de/jplag/java17/Bug58.java
  34. 0 296
      jplag.frontend.java-1.7/src/test/java/de/jplag/java17/ParserTest.java
  35. 0 22
      jplag.frontend.java-1.7/src/test/resources/AnnotationText.java
  36. 0 15
      jplag.frontend.java-1.7/src/test/resources/AnonymousClass.java
  37. 0 15
      jplag.frontend.java-1.7/src/test/resources/ArrayTest.java
  38. 0 32
      jplag.frontend.java-1.7/src/test/resources/Calendar.java
  39. 0 0
      jplag.frontend.java-1.7/src/test/resources/EmptyFile.java
  40. 0 5
      jplag.frontend.java-1.7/src/test/resources/EmptyFileOneComment.java
  41. 0 2
      jplag.frontend.java-1.7/src/test/resources/EmptyFileOnlyComments.java
  42. 0 27
      jplag.frontend.java-1.7/src/test/resources/EnumTest.java
  43. 0 7
      jplag.frontend.java-1.7/src/test/resources/ExceptionOne.java
  44. 0 5
      jplag.frontend.java-1.7/src/test/resources/ExceptionThree.java
  45. 0 7
      jplag.frontend.java-1.7/src/test/resources/ExceptionTwo.java
  46. 0 31
      jplag.frontend.java-1.7/src/test/resources/GenericPocket.java
  47. 0 24
      jplag.frontend.java-1.7/src/test/resources/IfElsifElse.java
  48. 0 21
      jplag.frontend.java-1.7/src/test/resources/InnerClass.java
  49. 0 5
      jplag.frontend.java-1.7/src/test/resources/J7Generics.java
  50. 0 13
      jplag.frontend.java-1.7/src/test/resources/J7StringSwitch.java
  51. 0 43
      jplag.frontend.java-1.7/src/test/resources/J7TryCatch.java
  52. 0 112
      jplag.frontend.java-1.7/src/test/resources/Java7FeatureTest.java
  53. 0 31
      jplag.frontend.java-1.7/src/test/resources/OptimizeAnnotation.java
  54. 0 13
      jplag.frontend.java-1.7/src/test/resources/SimpleClass.java
  55. 0 2
      jplag.frontend.java-1.7/src/test/resources/package-info.java
  56. 3 3
      jplag.frontend.java/pom.xml
  57. 1 1
      jplag.frontend.java/src/main/java/de/jplag/java/JavaToken.java
  58. 1 1
      jplag.frontend.java/src/main/java/de/jplag/java/JavaTokenConstants.java
  59. 1 1
      jplag.frontend.java/src/main/java/de/jplag/java/JavacAdapter.java
  60. 1 1
      jplag.frontend.java/src/main/java/de/jplag/java/Language.java
  61. 1 1
      jplag.frontend.java/src/main/java/de/jplag/java/Parser.java
  62. 1 1
      jplag.frontend.java/src/main/java/de/jplag/java/TokenGeneratingTreeScanner.java
  63. 1 16
      jplag.parent/pom.xml
  64. 1 16
      jplag/pom.xml
  65. 1 1
      jplag/src/main/java/de/jplag/options/LanguageOption.java
  66. 1 14
      pom.xml

+ 0 - 110
jplag.frontend.java-1.1exp/pom.xml

@@ -1,110 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <artifactId>java-1.1exp</artifactId>
-  <version>0.0.1-SNAPSHOT</version>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>build-helper-maven-plugin</artifactId>
-        <version>3.2.0</version>
-        <configuration>
-          <sources>
-            <source>target/generated-sources/javacc</source>
-          </sources>
-        </configuration>
-        <executions>
-          <execution>
-            <id>add-javacc-source</id>
-            <phase>generate-sources</phase>
-            <goals>
-              <goal>add-source</goal>
-            </goals>
-
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>javacc-maven-plugin</artifactId>
-        <version>2.6</version>
-        <configuration>
-          <isStatic>false</isStatic>
-        </configuration>
-        <executions>
-          <execution>
-            <id>javacc</id>
-            <goals>
-              <goal>javacc</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-jar-plugin</artifactId>
-        <configuration>
-          <archive>
-            <manifest>
-              <mainClass>de.jplag.javax.Parser</mainClass>
-              <packageName>jplag.javax</packageName>
-            </manifest>
-          </archive>
-        </configuration>
-      </plugin>
-    </plugins>
-    <pluginManagement>
-      <plugins>
-        <!--This plugin's configuration is used to store Eclipse m2e settings 
-          only. It has no influence on the Maven build itself. -->
-        <plugin>
-          <groupId>org.eclipse.m2e</groupId>
-          <artifactId>lifecycle-mapping</artifactId>
-          <version>1.0.0</version>
-          <configuration>
-            <lifecycleMappingMetadata>
-              <pluginExecutions>
-                <pluginExecution>
-                  <pluginExecutionFilter>
-                    <groupId>
-                      org.codehaus.mojo
-                    </groupId>
-                    <artifactId>
-                      javacc-maven-plugin
-                    </artifactId>
-                    <versionRange>
-                      [2.6,)
-                    </versionRange>
-                    <goals>
-                      <goal>javacc</goal>
-                    </goals>
-                  </pluginExecutionFilter>
-                  <action>
-                    <ignore></ignore>
-                  </action>
-                </pluginExecution>
-              </pluginExecutions>
-            </lifecycleMappingMetadata>
-          </configuration>
-        </plugin>
-      </plugins>
-    </pluginManagement>
-  </build>
-
-  <dependencies>
-    <dependency>
-      <groupId>de.jplag</groupId>
-      <artifactId>frontend-utils</artifactId>
-    </dependency>
-  </dependencies>
-  <parent>
-    <groupId>de.jplag</groupId>
-    <artifactId>parent</artifactId>
-    <version>0.3-SNAPSHOT</version>
-    <relativePath>../jplag.parent/pom.xml</relativePath>
-  </parent>
-</project>

+ 0 - 130
jplag.frontend.java-1.1exp/src/main/java/de/jplag/javax/JavaToken.java

@@ -1,130 +0,0 @@
-package de.jplag.javax;
-
-import de.jplag.Token;
-
-public class JavaToken extends Token implements JavaTokenConstants {
-	private static final long serialVersionUID = 8090049637477580276L;
-	private int line;
-
-	public JavaToken(int type, String file, int line) {
-		super(type, file, line);
-	}
-
-	@Override
-    public int getLine() {
-		return line;
-	}
-
-	@Override
-    public void setLine(int line) {
-		this.line = line;
-	}
-
-	@Override
-    public int getColumn() {
-		return 0;
-	}
-
-	@Override
-    public int getLength() {
-		return 0;
-	}
-
-	public static String type2string(int type) {
-		switch (type) {
-	    case JavaTokenConstants.FILE_END:
-	                            return "FILE_END";
-	    case J_PACKAGE:         return "J_PACKAGE";
-	    case J_IMPORT:          return "J_IMPORT";
-	    case J_CLASS_BEGIN:     return "J_CLASS_BEGIN";
-	    case J_CLASS_END:       return "J_CLASS_END";
-	    case J_METHOD_BEGIN:    return "J_METHOD_BEGIN";
-	    case J_METHOD_END:      return "J_METHOD_END";
-	    case J_VARDEF:          return "J_VARDEF";
-	    case J_SYNC_BEGIN:      return "J_SYNC_BEGIN";
-	    case J_SYNC_END:        return "J_SYNC_END";
-	    case J_DO_BEGIN:        return "J_DO_BEGIN";
-	    case J_DO_END:          return "J_DO_END";
-	    case J_WHILE_BEGIN:     return "J_WHILE_BEGIN";
-	    case J_WHILE_END:       return "J_WHILE_END";
-	    case J_FOR_BEGIN:       return "J_FOR_BEGIN";
-	    case J_FOR_END:         return "J_FOR_END";
-	    case J_SWITCH_BEGIN:    return "J_SWITCH_BEGIN";
-	    case J_SWITCH_END:      return "J_SWITCH_END";
-	    case J_CASE:            return "J_CASE";
-	    case J_TRY_BEGIN:       return "J_TRY_BEGIN";
-	    case J_CATCH_BEGIN:     return "J_CATCH_BEGIN";
-	    case J_CATCH_END:       return "J_CATCH_END";
-	    case J_FINALLY:         return "J_FINALLY";
-	    case J_IF_BEGIN:        return "J_IF_BEGIN";
-	    case J_ELSE:            return "J_ELSE";
-	    case J_IF_END:          return "J_IF_END";
-	    case J_COND:            return "J_COND";
-	    case J_BREAK:           return "J_BREAK";
-	    case J_CONTINUE:        return "J_CONTINUE";
-	    case J_RETURN:          return "J_RETURN";
-	    case J_THROW:           return "J_THROW";
-	    case J_IN_CLASS_BEGIN:  return "J_IN_CLASS_BEGIN";
-	    case J_IN_CLASS_END:    return "J_IN_CLASS_END";
-	    case J_APPLY:           return "J_APPLY";
-	    case J_NEWCLASS:        return "J_NEWCLASS";
-	    case J_NEWARRAY:        return "J_NEWARRAY";
-	    case J_ASSIGN:          return "J_ASSIGN";
-	    case J_INTERFACE_BEGIN: return "J_INTERFACE_BEGIN";
-	    case J_INTERFACE_END:   return "J_INTERFACE_END";
-	    case J_CONSTR_BEGIN:    return "J_CONSTR_BEGIN";
-	    case J_CONSTR_END:      return "J_CONSTR_END";
-	    case J_INIT_BEGIN:      return "J_INIT_BEGIN";
-	    case J_INIT_END:        return "J_INIT_END";
-	    case J_VOID:            return "J_VOID";
-	    case J_ABSTRACT:        return "J_ABSTRACT";
-	    case J_FINAL:           return "J_FINAL";
-	    case J_PUBLIC:          return "J_PUBLIC";
-	    case J_STATIC:          return "J_STATIC";
-	    case J_PROTECTED:       return "J_PROTECTED";
-	    case J_PRIVATE:         return "J_PRIVATE";
-	    case J_EXTENDS:         return "J_EXTENDS";
-	    case J_TRANSIENT:       return "J_TRANSIENT";
-	    case J_VOLANTILE:       return "J_VOLANTILE";
-	    case J_ARRAY_INIT:      return "J_ARRAY_INIT";
-	    case J_NATIVE:          return "J_NATIVE";
-	    case J_SYNCHRONIZED:    return "J_SYNCHRONIZED";
-	    case J_THROWS:          return "J_THROWS";
-	    case J_THIS:            return "J_THIS";
-	    case J_BOOLEAN_TYPE:    return "J_BOOLEAN_TYPE";
-	    case J_CHAR_TYPE:       return "J_CHAR_TYPE";
-	    case J_BYTE_TYPE:       return "J_BYTE_TYPE";
-	    case J_SHORT_TYPE:      return "J_SHORT_TYPE";
-	    case J_INT_TYPE:        return "J_INT_TYPE";
-	    case J_LONG_TYPE:       return "J_LONG_TYPE";
-	    case J_FLOAT_TYPE:      return "J_FLOAT_TYPE";
-	    case J_DOUBLE_TYPE:     return "J_DOUBLE_TYPE";
-	    case J_ASSIGNOP:        return "J_ASSIGNOP";
-	    case J_ASSIGNBITOP:     return "J_ASSIGNBITOP";
-	    case J_COND_OR:         return "J_COND_OR";
-	    case J_COND_AND:        return "J_COND_AND";
-	    case J_COND_IOR:        return "J_COND_IOR";
-	    case J_COND_XOR:        return "J_COND_XOR";
-	    case J_AND:             return "J_AND";
-	    case J_EQUALITY:        return "J_EQUALITY";
-	    case J_INSTANCEOF:      return "J_INSTANCEOF";
-	    case J_SHIFT:           return "J_SHIFT";
-	    case J_RELATIONAL:      return "J_RELATIONAL";
-	    case J_ADD:             return "J_ADD";
-	    case J_MULT:            return "J_MULT";
-	    case J_DECINC:          return "J_DECINC";
-	    case J_CAST:            return "J_CAST";
-	    case J_SUPER:           return "J_SUPER";
-	      //case J_LITERAL:         return "J_LITERAL";
-	    case J_NULL:            return "J_NULL";
-	    case J_LABEL:           return "J_LABEL";
-	    case J_INT:             return "J_INT";
-	    case J_FLOAT:           return "J_FLOAT";
-	    case J_CHAR:            return "J_CHAR";
-	    case J_STRING:          return "J_STRING";
-	    case J_BOOLEAN:         return "J_BOOLEAN";
-	
-	    default:           return "<UNBEKANNT>";
-		}
-	}
-}

+ 0 - 102
jplag.frontend.java-1.1exp/src/main/java/de/jplag/javax/JavaTokenConstants.java

@@ -1,102 +0,0 @@
-package de.jplag.javax;
-
-import de.jplag.TokenConstants;
-
-//import java.io.*;
-
-public interface JavaTokenConstants extends TokenConstants {
-  final static int FILE_END = 0;
-
-  final static int J_PACKAGE =          1;  
-  final static int J_IMPORT =           2;  
-  final static int J_CLASS_BEGIN =      3;  
-  final static int J_CLASS_END =        4;  
-  final static int J_METHOD_BEGIN =     5;  
-  final static int J_METHOD_END =       6;  
-  final static int J_VARDEF =           7;  
-  final static int J_SYNC_BEGIN =       8;  
-  final static int J_SYNC_END =         9;  
-  final static int J_DO_BEGIN =        10;  
-  final static int J_DO_END =          11;  
-  final static int J_WHILE_BEGIN =     12;  
-  final static int J_WHILE_END =       13;  
-  final static int J_FOR_BEGIN =       14;  
-  final static int J_FOR_END =         15;  
-  final static int J_SWITCH_BEGIN =    16;  
-  final static int J_SWITCH_END =      17;  
-  final static int J_CASE =            18;  
-  final static int J_TRY_BEGIN =       19;  
-  final static int J_CATCH_BEGIN =     20;  
-  final static int J_CATCH_END =       21;  
-  final static int J_FINALLY =         22;  
-  final static int J_IF_BEGIN =        23;  
-  final static int J_ELSE =            24;  
-  final static int J_IF_END =          25;  
-  final static int J_COND =            26;  
-  final static int J_BREAK =           27;  
-  final static int J_CONTINUE =        28;  
-  final static int J_RETURN =          29;  
-  final static int J_THROW =           30;  
-  final static int J_IN_CLASS_BEGIN=   31;  
-  final static int J_IN_CLASS_END =    32;  
-  final static int J_APPLY =           33;  
-  final static int J_NEWCLASS =        34;  
-  final static int J_NEWARRAY =        35;  
-  final static int J_ASSIGN =          36;  
-  final static int J_INTERFACE_BEGIN=  37;  
-  final static int J_INTERFACE_END =   38;  
-  final static int J_CONSTR_BEGIN =    39;  
-  final static int J_CONSTR_END =      40;  
-  final static int J_INIT_BEGIN =      41;  
-  final static int J_INIT_END =        42;  
-  final static int J_VOID =            43;  
-  // new tokens:
-  final static int J_ABSTRACT =        44;
-  final static int J_FINAL =           45;
-  final static int J_PUBLIC =          46;
-  final static int J_STATIC =          47;
-  final static int J_PROTECTED =       48;
-  final static int J_PRIVATE =         49;
-  final static int J_EXTENDS =         50;
-  final static int J_TRANSIENT =       51;
-  final static int J_VOLANTILE =       52;
-  final static int J_ARRAY_INIT =      53;
-  final static int J_NATIVE =          54;
-  final static int J_SYNCHRONIZED =    55;
-  final static int J_THROWS =          56;
-  final static int J_THIS =            57;
-  final static int J_BOOLEAN_TYPE =    58;
-  final static int J_CHAR_TYPE =       59;
-  final static int J_BYTE_TYPE =       60;
-  final static int J_SHORT_TYPE =      61;
-  final static int J_INT_TYPE =        62;
-  final static int J_LONG_TYPE =       63;
-  final static int J_FLOAT_TYPE =      64;
-  final static int J_DOUBLE_TYPE =     65;
-  final static int J_ASSIGNOP =        66;
-  final static int J_ASSIGNBITOP =     67;
-  final static int J_COND_OR =         68;
-  final static int J_COND_AND =        69;
-  final static int J_COND_IOR =        70;
-  final static int J_COND_XOR =        71;
-  final static int J_AND =             72;
-  final static int J_EQUALITY =        73;
-  final static int J_INSTANCEOF =      74;
-  final static int J_SHIFT =           75;
-  final static int J_RELATIONAL =      76;
-  final static int J_ADD =             77;
-  final static int J_MULT =            78;
-  final static int J_DECINC =          79;
-  final static int J_CAST =            80;
-  final static int J_SUPER =           81;
-  //  final static int J_LITERAL =         82;
-  final static int J_NULL =            83;
-  final static int J_LABEL =           84;
-  final static int J_INT =             85;
-  final static int J_FLOAT =           86;
-  final static int J_CHAR =            87;
-  final static int J_STRING =          88;
-  final static int J_BOOLEAN =         89;
-
-  final static int NUM_DIFF_TOKENS =   90;
-}

+ 0 - 77
jplag.frontend.java-1.1exp/src/main/java/de/jplag/javax/Language.java

@@ -1,77 +0,0 @@
-package de.jplag.javax;
-
-import java.io.File;
-
-import de.jplag.ErrorConsumer;
-import de.jplag.TokenList;
-
-public class Language implements de.jplag.Language {
-	private Parser parser;
-
-	public Language(ErrorConsumer program) {
-		this.parser = new Parser();
-		this.parser.setProgram(program);
-
-	}
-
-	@Override
-    public int errorCount() {
-		return this.parser.errorsCount();
-	}
-
-	@Override
-    public String[] suffixes() {
-		String[] res = { ".java", ".jav", ".JAVA", ".JAV" };
-		return res;
-	}
-
-	@Override
-    public String getName() {
-		return "experimental Java1.1";
-	}
-
-	@Override
-    public String getShortName() {
-		return "Java1.1(exp)";
-	}
-
-	@Override
-    public int minimumTokenMatch() {
-		return 15;
-	}
-
-	@Override
-    public boolean supportsColumns() {
-		return false;
-	}
-
-	@Override
-    public boolean isPreformatted() {
-		return true;
-	}
-
-	@Override
-    public boolean usesIndex() {
-		return false;
-	}
-
-	@Override
-    public TokenList parse(File dir, String[] files) {
-		return this.parser.parse(dir, files);
-	}
-
-	@Override
-    public boolean hasErrors() {
-		return this.parser.hasErrors();
-	}
-
-	@Override
-    public int numberOfTokens() {
-		return JavaTokenConstants.NUM_DIFF_TOKENS;
-	}
-
-	@Override
-    public String type2string(int type) {
-		return JavaToken.type2string(type);
-	}
-}

+ 0 - 37
jplag.frontend.java-1.1exp/src/main/java/de/jplag/javax/Parser.java

@@ -1,37 +0,0 @@
-package de.jplag.javax;
-
-import java.io.File;
-
-import de.jplag.AbstractParser;
-import de.jplag.TokenList;
-
-public class Parser extends AbstractParser implements JavaTokenConstants {
-	private String actFile;
-
-	private TokenList struct;
-
-	public TokenList parse(File dir, String files[]) {
-		struct = new TokenList();
-		errors = 0;
-		JavaParser parser = null;// no worry it will be reinitialized
-		// in method parseFile(...)
-		for (int i = 0; i < files.length; i++) {
-			actFile = files[i];
-			getErrorConsumer().print(null, "Parsing file " + files[i]);
-			if (!JavaParser.parseFile(dir, files[i], parser, this))
-				errors++;
-			struct.addToken(new JavaToken(FILE_END, actFile, 0));
-		}
-		if (errors == 0)
-			errorConsumer.print(null, "OK");
-		else
-			errorConsumer.print(null, errors + " ERRORS");
-		this.parseEnd();
-		return struct;
-	}
-
-	public void add(int type, Token token) {
-		struct.addToken(new JavaToken(type, actFile, token.beginLine));
-	}
-
-}

+ 0 - 1186
jplag.frontend.java-1.1exp/src/main/javacc/Java1.1.jj

@@ -1,1186 +0,0 @@
-/* Hey Emacs, this is -*- mode: java; page-delimiter: "^%%$"; -*- */
-
-/**
- *
- * Copyright (C) 1996, 1997 Sun Microsystems Inc.
- *
- * Use of this file and the system it is part of is constrained by the
- * file COPYRIGHT in the root directory of this system.  You may, however,
- * make any modifications you wish to this file.
- *
- * Java files generated by running JavaCC on this file (or modified versions
- * of this file) may be used in exactly the same manner as Java files
- * generated from any grammar developed by you.
- *
- * Author: Sriram Sankar     (sriram@metamata.com)
- * Date: 3/5/97
- *
- * This file contains a Java grammar and actions that implement a front-end.
- *
- */
-
-options {
-  JAVA_UNICODE_ESCAPE = true;
-}
-
-PARSER_BEGIN(JavaParser)
-package de.jplag.javax;
-import java.io.*;
-
-public class JavaParser implements JavaTokenConstants {
-  //static JavaParser parser = null;
- private   de.jplag.javax.Parser parser2 ;
-  public static boolean parseFile(File dir, String fileName,de.jplag.javax.JavaParser parser,de.jplag.javax.Parser parserX) {
-    File file=null;
-    try {
-      FileInputStream in = new FileInputStream(file=new File(dir,fileName));
-      if (parser==null) {
-	parser = new JavaParser(in);
-      } else {
-	parser.ReInit(in);
-      }
-       parser.parser2=parserX;
-    } catch (FileNotFoundException e) {
-      System.out.println("Java EXPERIMENTAL Parser Version 1.1:  File "+
-			 fileName +" not found.");
-      return false;
-    }
-    try {
-      parser.CompilationUnit();
-    } catch (ParseException e) {
-      parserX.getErrorConsumer().addError("  Parsing Error in '" + fileName + "':\n  "
-                + e.getMessage());
-      return false;
-    } catch (TokenMgrError e) {
-      parserX.getErrorConsumer().addError("  Scanning Error in '" + fileName
-      		+ "':\n  " + e.getMessage());
-      return true; //false;		// TODO: Why has this been manually set to true?
-    }
-    return true;
-  }
-
- /* public static void main(String args[]) {
-    parseFile(new File("."),args[0]);
-  }
-  */
-
-}
-
-PARSER_END(JavaParser)
-
-
-/* WHITE SPACE */
-
-SKIP :
-{
-  " "
-| "\t"
-| "\n"
-| "\r"
-| "\f"
-| "\u001a"
-
-}
-
-/* COMMENTS */
-
-MORE :
-{
-  "//" : IN_SINGLE_LINE_COMMENT
-|
-  <"/**" ~["/"]> { input_stream.backup(1); } : IN_FORMAL_COMMENT
-|
-  "/*" : IN_MULTI_LINE_COMMENT
-}
-
-<IN_SINGLE_LINE_COMMENT>
-SPECIAL_TOKEN :
-{
-  <SINGLE_LINE_COMMENT: "\n" | "\r" | "\r\n"> : DEFAULT
-}
-
-<IN_FORMAL_COMMENT>
-SPECIAL_TOKEN :
-{
-  <FORMAL_COMMENT: "*/" > : DEFAULT
-}
-
-<IN_MULTI_LINE_COMMENT>
-SPECIAL_TOKEN :
-{
-  <MULTI_LINE_COMMENT: "*/" > : DEFAULT
-}
-
-<IN_SINGLE_LINE_COMMENT,IN_FORMAL_COMMENT,IN_MULTI_LINE_COMMENT>
-MORE :
-{
-  < ~[] >
-}
-
-/* RESERVED WORDS AND LITERALS */
-
-TOKEN :
-{
-  < ABSTRACT: "abstract" >
-| < 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" >
-| < 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" >
-| < 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 :
-{
-  < INTEGER_LITERAL:
-        <DECIMAL_LITERAL> (["l","L"])?
-      | <HEX_LITERAL> (["l","L"])?
-      | <OCTAL_LITERAL> (["l","L"])?
-  >
-|
-  < #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:
-        (["0"-"9"])+ "." (["0"-"9"])* (<EXPONENT>)? (["f","F","d","D"])?
-      | "." (["0"-"9"])+ (<EXPONENT>)? (["f","F","d","D"])?
-      | (["0"-"9"])+ <EXPONENT> (["f","F","d","D"])?
-      | (["0"-"9"])+ (<EXPONENT>)? ["f","F","d","D"]
-  >
-|
-  < #EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+ >
-|
-  < CHARACTER_LITERAL:
-      "'"
-      (   (~["'","\\","\n","\r"])
-        | ("\\"
-            ( ["n","t","b","r","f","\\","'","\""]
-            | ["0"-"7"] ( ["0"-"7"] )?
-            | ["0"-"3"] ["0"-"7"] ["0"-"7"]
-            )
-          )
-      )
-      "'"
-  >
-|
-  < STRING_LITERAL:
-      "\""
-      (   (~["\"","\\","\n","\r"])
-        | ("\\"
-            ( ["n","t","b","r","f","\\","'","\""]
-            | ["0"-"7"] ( ["0"-"7"] )?
-            | ["0"-"3"] ["0"-"7"] ["0"-"7"]
-            )
-          )
-      )*
-      "\""
-  >
-}
-
-/* IDENTIFIERS */
-
-TOKEN :
-{
-  < IDENTIFIER: <LETTER> (<LETTER>|<DIGIT>)* >
-|
-  < #LETTER:
-      [
-       "\u0024",
-       "\u0041"-"\u005a",
-       "\u005f",
-       "\u0061"-"\u007a",
-       "\u00c0"-"\u00d6",
-       "\u00d8"-"\u00f6",
-       "\u00f8"-"\u00ff",
-       "\u0100"-"\u1fff",
-       "\u3040"-"\u318f",
-       "\u3300"-"\u337f",
-       "\u3400"-"\u3d2d",
-       "\u4e00"-"\u9fff",
-       "\uf900"-"\ufaff"
-      ]
-  >
-|
-  < #DIGIT:
-      [
-       "\u0030"-"\u0039",
-       "\u0660"-"\u0669",
-       "\u06f0"-"\u06f9",
-       "\u0966"-"\u096f",
-       "\u09e6"-"\u09ef",
-       "\u0a66"-"\u0a6f",
-       "\u0ae6"-"\u0aef",
-       "\u0b66"-"\u0b6f",
-       "\u0be7"-"\u0bef",
-       "\u0c66"-"\u0c6f",
-       "\u0ce6"-"\u0cef",
-       "\u0d66"-"\u0d6f",
-       "\u0e50"-"\u0e59",
-       "\u0ed0"-"\u0ed9",
-       "\u1040"-"\u1049"
-      ]
-  >
-}
-
-/* SEPARATORS */
-
-TOKEN :
-{
-  < LPAREN: "(" >
-| < RPAREN: ")" >
-| < LBRACE: "{" >
-| < RBRACE: "}" >
-| < LBRACKET: "[" >
-| < RBRACKET: "]" >
-| < SEMICOLON: ";" >
-| < COMMA: "," >
-| < DOT: "." >
-}
-
-/* OPERATORS */
-
-TOKEN :
-{
-  < ASSIGN: "=" >
-| < GT: ">" >
-| < 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: "<<" >
-| < RSIGNEDSHIFT: ">>" >
-| < RUNSIGNEDSHIFT: ">>>" >
-| < PLUSASSIGN: "+=" >
-| < MINUSASSIGN: "-=" >
-| < STARASSIGN: "*=" >
-| < SLASHASSIGN: "/=" >
-| < ANDASSIGN: "&=" >
-| < ORASSIGN: "|=" >
-| < XORASSIGN: "^=" >
-| < REMASSIGN: "%=" >
-| < LSHIFTASSIGN: "<<=" >
-| < RSIGNEDSHIFTASSIGN: ">>=" >
-| < RUNSIGNEDSHIFTASSIGN: ">>>=" >
-}
-
-
-/*****************************************
- * THE JAVA LANGUAGE GRAMMAR STARTS HERE *
- *****************************************/
-
-/*
- * Program structuring syntax follows.
- */
-
-void CompilationUnit() :
-{}
-{
-  [ PackageDeclaration() ]
-  ( ImportDeclaration() )*
-  ( TypeDeclaration() )*
-  <EOF>
-}
-
-void PackageDeclaration() :
-{}
-{
-  "package" Name() ";"                { parser2.add(J_PACKAGE,token); }
-}
-
-void ImportDeclaration() :
-{}
-{
-  "import" Name() [ "." "*" ] ";"     { parser2.add(J_IMPORT,token); }
-}
-
-void TypeDeclaration() :
-{}
-{
-  LOOKAHEAD( ( "abstract" | "final" | "public" )* "class" )
-  ClassDeclaration()
-|
-  InterfaceDeclaration()
-|
-  ";"
-}
-
-
-/*
- * Declaration syntax follows.
- */
-
-void ClassDeclaration() :
-{}
-{
-  ( "abstract" { parser2.add(J_ABSTRACT,token); }
-    | "final"  { parser2.add(J_FINAL,token); }
-    | "public" { parser2.add(J_PUBLIC,token); } )*
-  UnmodifiedClassDeclaration()
-}
-
-void UnmodifiedClassDeclaration() :
-{}
-{
-  "class" <IDENTIFIER>                { parser2.add(J_CLASS_BEGIN,token); }
-  [ "extends" Name() ] [ "implements" NameList() ]
-  ClassBody()                         { parser2.add(J_CLASS_END,token); }
-}
-
-void ClassBody() :
-{}
-{
-  "{" ( ClassBodyDeclaration() )* "}"
-}
-
-void NestedClassDeclaration() :
-{}
-{
-  ( "static"     { parser2.add(J_STATIC,token); }
-    | "abstract" { parser2.add(J_ABSTRACT,token); }
-    | "final"    { parser2.add(J_FINAL,token); }
-    | "public"   { parser2.add(J_PUBLIC,token); }
-    | "protected"{ parser2.add(J_PROTECTED,token); }
-    | "private"  { parser2.add(J_PRIVATE,token); } )*
-  UnmodifiedClassDeclaration()
-}
-
-void ClassBodyDeclaration() :
-{}
-{
-  LOOKAHEAD(2)
-  Initializer()
-|
-  LOOKAHEAD( ( "static" | "abstract" | "final" | "public" | "protected" | "private" )* "class" )
-  NestedClassDeclaration()
-|
-  LOOKAHEAD( ( "static" | "abstract" | "final" | "public" | "protected" | "private" )* "interface" )
-  NestedInterfaceDeclaration()
-|
-  LOOKAHEAD( [ "public" | "protected" | "private" ] Name() "(" )
-  ConstructorDeclaration()
-|
-  LOOKAHEAD( MethodDeclarationLookahead() )
-  MethodDeclaration()
-|
-  FieldDeclaration()
-}
-
-// This production is to determine lookahead only.
-void MethodDeclarationLookahead() :
-{}
-{
-  ( "public" | "protected" | "private" | "static" | "abstract" | "final" | "native" | "synchronized" )*
-  ResultType() <IDENTIFIER> "("
-}
-
-void InterfaceDeclaration() :
-{}
-{
-  ( "abstract" { parser2.add(J_ABSTRACT,token); }
-    | "public" { parser2.add(J_PUBLIC,token); } )*
-  UnmodifiedInterfaceDeclaration()
-}
-
-void NestedInterfaceDeclaration() :
-{}
-{
-  ( "static"     { parser2.add(J_STATIC,token); }
-    | "abstract" { parser2.add(J_ABSTRACT,token); }
-    | "final"    { parser2.add(J_FINAL,token); }
-    | "public"   { parser2.add(J_PUBLIC,token); }
-    | "protected"{ parser2.add(J_PROTECTED,token); }
-    | "private"  { parser2.add(J_PRIVATE,token); } )*
-  UnmodifiedInterfaceDeclaration()
-}
-
-void UnmodifiedInterfaceDeclaration() :
-{}
-{
-  "interface" <IDENTIFIER>             { parser2.add(J_INTERFACE_BEGIN,token); }
-  [ "extends"                          { parser2.add(J_EXTENDS,token); }
-    NameList() ]
-  "{" ( InterfaceMemberDeclaration() )* "}"
-                                       { parser2.add(J_INTERFACE_END,token); }
-}
-
-void InterfaceMemberDeclaration() :
-{}
-{
-  LOOKAHEAD( ( "static" | "abstract" | "final" | "public" | "protected" | "private" )* "class" )
-  NestedClassDeclaration()
-|
-  LOOKAHEAD( ( "static" | "abstract" | "final" | "public" | "protected" | "private" )* "interface" )
-  NestedInterfaceDeclaration()
-|
-  LOOKAHEAD( MethodDeclarationLookahead() )
-  MethodDeclaration()
-|
-  FieldDeclaration()
-}
-
-void FieldDeclaration() :
-{}
-{
-  ( "public"     { parser2.add(J_PUBLIC,token); }
-    | "protected"{ parser2.add(J_PROTECTED,token); }
-    | "private"  { parser2.add(J_PRIVATE,token); }
-    | "static"   { parser2.add(J_STATIC,token); }
-    | "final"    { parser2.add(J_FINAL,token); }
-    | "transient"{ parser2.add(J_TRANSIENT,token); }
-    | "volatile" { parser2.add(J_VOLANTILE,token); } )*
-  Type() VariableDeclarator() ( "," VariableDeclarator() )* (";")+
-}
-
-void VariableDeclarator() :
-{}
-{
-  VariableDeclaratorId()                    { parser2.add(J_VARDEF,token); }
-  [ "="                                     { parser2.add(J_ASSIGN,token); }
-    VariableInitializer() ]
-}
-
-void VariableDeclaratorId() :
-{}
-{
-  <IDENTIFIER> ( "[" "]" )*
-}
-
-void VariableInitializer() :
-{}
-{
-  ArrayInitializer()
-|
-  Expression()
-}
-
-void ArrayInitializer() :
-{}
-{
-  "{"                 { parser2.add(J_ARRAY_INIT,token); }
-    [ VariableInitializer() ( LOOKAHEAD(2) "," VariableInitializer() )* ] [ "," ] "}"
-}
-
-void MethodDeclaration() :
-{}
-{
-  ( "public"        { parser2.add(J_PUBLIC,token); }
-    | "protected"   { parser2.add(J_PROTECTED,token); }
-    | "private"     { parser2.add(J_PRIVATE,token); }
-    | "static"      { parser2.add(J_STATIC,token); }
-    | "abstract"    { parser2.add(J_ABSTRACT,token); }
-    | "final"       { parser2.add(J_FINAL,token); }
-    | "native"      { parser2.add(J_NATIVE,token); }
-    | "synchronized"{ parser2.add(J_SYNCHRONIZED,token); }  )*
-  ResultType() MethodDeclarator()        { parser2.add(J_METHOD_BEGIN,token); }
-  [ "throws" { parser2.add(J_THROWS,token); } NameList() ]
-  ( Block() | ";" ) (";")*               { parser2.add(J_METHOD_END,token); }
-}
-
-void MethodDeclarator() :
-{}
-{
-  <IDENTIFIER> FormalParameters() ( "[" "]" )*
-}
-
-void FormalParameters() :
-{}
-{
-  "(" [ FormalParameter() ( "," FormalParameter() )* ] ")"
-}
-
-void FormalParameter() :
-{}
-{
-  [ "final" { parser2.add(J_FINAL,token); } ] Type() VariableDeclaratorId()
-}
-
-void ConstructorDeclaration() :
-{}
-{
-  [ "public"      { parser2.add(J_PUBLIC,token); }
-    | "protected" { parser2.add(J_PROTECTED,token); }
-    | "private"   { parser2.add(J_PRIVATE,token); } ]
-  <IDENTIFIER>                           { parser2.add(J_CONSTR_BEGIN,token); }
-    FormalParameters() [ "throws" { parser2.add(J_THROWS,token); }
-		         NameList() ] "{"
-    [ LOOKAHEAD(ExplicitConstructorInvocation()) ExplicitConstructorInvocation() ]
-    ( BlockStatement() )*
-  "}" (";")*                             { parser2.add(J_CONSTR_END,token); }
-}
-
-void ExplicitConstructorInvocation() :
-{}
-{
-  LOOKAHEAD("this" Arguments() ";")
-  "this" { parser2.add(J_THIS,token); } Arguments() ";"
-|
-  [ LOOKAHEAD(2) PrimaryExpression() "." ] "super" Arguments() ";"
-}
-
-void Initializer() :
-{}
-{
-  [ "static" ]                
-                                     { parser2.add(J_INIT_BEGIN,token); }
-  Block()                            { parser2.add(J_INIT_END,token); }
-}
-
-
-/*
- * Type, name and expression syntax follows.
- */
-
-void Type() :
-{}
-{
-  ( PrimitiveType() | Name() ) ( "[" "]" )*
-}
-
-void PrimitiveType() :
-{}
-{
-  "boolean" { parser2.add(J_BOOLEAN_TYPE,token); }
-|
-  "char"    { parser2.add(J_CHAR_TYPE,token); }
-|
-  "byte"    { parser2.add(J_BYTE_TYPE,token); }
-|
-  "short"   { parser2.add(J_SHORT_TYPE,token); }
-|
-  "int"     { parser2.add(J_INT_TYPE,token); }
-|
-  "long"    { parser2.add(J_LONG_TYPE,token); }
-|
-  "float"   { parser2.add(J_FLOAT_TYPE,token); }
-|
-  "double"  { parser2.add(J_DOUBLE_TYPE,token); }
-}
-
-void ResultType() :
-{}
-{
-  "void"                              { parser2.add(J_VOID,token); }
-|
-  Type()
-}
-
-void Name() :
-/*
- * A lookahead of 2 is required below since "Name" can be followed
- * by a ".*" when used in the context of an "ImportDeclaration".
- */
-{}
-{
-  <IDENTIFIER>
-  ( LOOKAHEAD(2) "." <IDENTIFIER>
-  )*
-}
-
-void NameList() :
-{}
-{
-  Name()
-  ( "," Name()
-  )*
-}
-
-
-/*
- * Expression syntax follows.
- */
-
-void 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.
- */
-{}
-{
-  ConditionalExpression()
-  [ 
-    AssignmentOperator() Expression()
-  ]
-}
-
-void AssignmentOperator() :
-{}
-{
-  ("="      { parser2.add(J_ASSIGN,token); }
-   | "*="   { parser2.add(J_ASSIGNOP,token); }
-   | "/="   { parser2.add(J_ASSIGNOP,token); }
-   | "%="   { parser2.add(J_ASSIGNOP,token); }
-   | "+="   { parser2.add(J_ASSIGNOP,token); }
-   | "-="   { parser2.add(J_ASSIGNOP,token); }
-   | "<<="  { parser2.add(J_ASSIGNBITOP,token); }
-   | ">>="  { parser2.add(J_ASSIGNBITOP,token); }
-   | ">>>=" { parser2.add(J_ASSIGNBITOP,token); }
-   | "&="   { parser2.add(J_ASSIGNBITOP,token); }
-   | "^="   { parser2.add(J_ASSIGNBITOP,token); }
-   | "|="   { parser2.add(J_ASSIGNBITOP,token); } )
-}
-
-void ConditionalExpression() :
-{}
-{
-  ConditionalOrExpression()
-  [ { parser2.add(J_COND,token); } "?" Expression() ":" ConditionalExpression() ]
-}
-
-void ConditionalOrExpression() :
-{}
-{
-  ConditionalAndExpression() ( "||" { parser2.add(J_COND_OR,token); }
-  ConditionalAndExpression() )*
-}
-
-void ConditionalAndExpression() :
-{}
-{
-  InclusiveOrExpression() ( "&&" { parser2.add(J_COND_AND,token); }
-  InclusiveOrExpression() )*
-}
-
-void InclusiveOrExpression() :
-{}
-{
-  ExclusiveOrExpression() ( "|" { parser2.add(J_COND_IOR,token); }
-  ExclusiveOrExpression() )*
-}
-
-void ExclusiveOrExpression() :
-{}
-{
-  AndExpression() ( "^" { parser2.add(J_COND_XOR,token); }
-  AndExpression() )*
-}
-
-void AndExpression() :
-{}
-{
-  EqualityExpression() ( "&" { parser2.add(J_AND,token); }
-  EqualityExpression() )*
-}
-
-void EqualityExpression() :
-{}
-{
-  InstanceOfExpression() ( ( "==" | "!=" ) { parser2.add(J_EQUALITY,token); }
-  InstanceOfExpression() )*
-}
-
-void InstanceOfExpression() :
-{}
-{
-  RelationalExpression() [ "instanceof" { parser2.add(J_INSTANCEOF,token); }
-					Type() ]
-}
-
-void RelationalExpression() :
-{}
-{
-  ShiftExpression() ( ( "<" | ">" | "<=" | ">=" ) { parser2.add(J_RELATIONAL,token); }
-  ShiftExpression() )*
-}
-
-void ShiftExpression() :
-{}
-{
-  AdditiveExpression() ( ( "<<" | ">>" | ">>>" ) { parser2.add(J_SHIFT,token); }
-  AdditiveExpression() )*
-}
-
-void AdditiveExpression() :
-{}
-{
-  MultiplicativeExpression() ( ( "+" | "-" ) { parser2.add(J_ADD,token); }
-  MultiplicativeExpression() )*
-}
-
-void MultiplicativeExpression() :
-{}
-{
-  UnaryExpression() ( ( "*" | "/" | "%" ) { parser2.add(J_MULT,token); }
-  UnaryExpression() )*
-}
-
-void UnaryExpression() :
-{}
-{
-  ( "+" | "-" ) UnaryExpression()
-|
-  PreIncrementExpression()
-|
-  PreDecrementExpression()
-|
-  UnaryExpressionNotPlusMinus()
-}
-
-void PreIncrementExpression() :
-{}
-{
-  "++" PrimaryExpression()             { parser2.add(J_DECINC,token); }
-}
-
-void PreDecrementExpression() :
-{}
-{
-  "--" PrimaryExpression()             { parser2.add(J_DECINC,token); }
-}
-
-void UnaryExpressionNotPlusMinus() :
-{}
-{
-  ( "~" | "!" ) UnaryExpression()
-|
-  LOOKAHEAD( CastLookahead() )
-  CastExpression()
-|
-  PostfixExpression()
-}
-
-// This production is to determine lookahead only.  The LOOKAHEAD specifications
-// below are not used, but they are there just to indicate that we know about
-// this.
-void CastLookahead() :
-{}
-{
-  LOOKAHEAD(2)
-  "(" PrimitiveType()
-|
-  LOOKAHEAD("(" Name() "[")
-  "(" Name() "[" "]"
-|
-  "(" Name() ")" ( "~" | "!" | "(" | <IDENTIFIER> | "this" | "super" | "new" | Literal() )
-}
-
-void PostfixExpression() :
-{}
-{
-  PrimaryExpression() [ ("++" | "--")         { parser2.add(J_DECINC,token); } ]
-}
-
-void CastExpression() :
-{}
-{
-  (LOOKAHEAD("(" PrimitiveType())
-      "(" Type() ")" UnaryExpression()
-       |
-       "(" Type() ")" UnaryExpressionNotPlusMinus()
-    ) { parser2.add(J_CAST,token); }
-}
-
-void PrimaryExpression() :
-{}
-{
-  PrimaryPrefix() ( LOOKAHEAD(2) PrimarySuffix() )*
-}
-
-void PrimaryPrefix() :
-{}
-{
-  Literal()
-|
-  "this"      { parser2.add(J_THIS,token); }
-|
-  "super"     { parser2.add(J_SUPER,token); }
-  "." <IDENTIFIER>
-|
-  "(" Expression() ")"
-|
-  AllocationExpression()
-|
-  LOOKAHEAD( ResultType() "." "class" )
-  ResultType() "." "class"
-|
-  Name()                                  { /*parser2.add(J_NAME,token);*/ }
-}
-
-void PrimarySuffix() :
-{}
-{
-  LOOKAHEAD(2)
-  "." "this"         { parser2.add(J_THIS,token); }
-|
-  LOOKAHEAD(2)
-  "." AllocationExpression()
-|
-  "[" Expression() "]"
-|
-  "." <IDENTIFIER>
-|
-  Arguments()                             { parser2.add(J_APPLY,token); }
-}
-
-void Literal() :
-{}
-{
-  <INTEGER_LITERAL>          { parser2.add(J_INT,token); }
-|
-  <FLOATING_POINT_LITERAL>   { parser2.add(J_FLOAT,token); }
-|
-  <CHARACTER_LITERAL>        { parser2.add(J_CHAR,token); }
-|
-  <STRING_LITERAL>           { parser2.add(J_STRING,token); }
-|
-  BooleanLiteral()           { parser2.add(J_BOOLEAN,token); }
-|
-  NullLiteral()
-}
-
-void BooleanLiteral() :
-{}
-{
-  "true"
-|
-  "false"
-}
-
-void NullLiteral() :
-{}
-{
-  "null"                          { parser2.add(J_NULL,token); }
-}
-
-void Arguments() :
-{}
-{
-  "(" [ ArgumentList() ] ")"
-}
-
-void ArgumentList() :
-{}
-{
-  Expression() ( "," Expression() )*
-}
-
-void AllocationExpression() :
-{}
-{
-  LOOKAHEAD(2)
-  "new"                                      { parser2.add(J_NEWARRAY,token); }
-    PrimitiveType() ArrayDimsAndInits()
-|
-  "new"                                      { parser2.add(J_NEWCLASS,token); }
-    Name() (
-      ArrayDimsAndInits()                    { parser2.add(J_NEWARRAY,token); }
-    |
-      Arguments()
-      [ { parser2.add(J_IN_CLASS_BEGIN,token); }
-	ClassBody()
-	{ parser2.add(J_IN_CLASS_END,token); } ]
-    )
-}
-
-/*
- * The third LOOKAHEAD specification below is to parse to PrimarySuffix
- * if there is an expression between the "[...]".
- */
-void ArrayDimsAndInits() :
-{}
-{
-  LOOKAHEAD(2)
-  ( LOOKAHEAD(2) "[" Expression() "]" )+ ( LOOKAHEAD(2) "[" "]" )*
-|
-  ( "[" "]" )+ ArrayInitializer()
-}
-
-
-/*
- * Statement syntax follows.
- */
-
-void Statement() :
-{}
-{
-  LOOKAHEAD(2)
-  LabeledStatement()
-|
-  Block()
-|
-  EmptyStatement()
-|
-  StatementExpression()                      { /*parser2.add(J_APPLY,token);*/ }
-  ";"
-|
-  SwitchStatement()
-|
-  IfStatement()
-|
-  WhileStatement()
-|
-  DoStatement()
-|
-  ForStatement()
-|
-  BreakStatement()
-|
-  ContinueStatement()
-|
-  ReturnStatement()
-|
-  ThrowStatement()
-|
-  SynchronizedStatement()
-|
-  TryStatement()
-}
-
-void LabeledStatement() :
-{}
-{
-  <IDENTIFIER> ":" Statement()   { parser2.add(J_LABEL,token); }
-}
-
-void Block() :
-{}
-{
-  "{" ( BlockStatement() )* "}"
-}
-
-void BlockStatement() :
-{}
-{
-  LOOKAHEAD([ "final" ] Type() <IDENTIFIER>)
-  LocalVariableDeclaration() ";"
-|
-  Statement()
-|
-  UnmodifiedClassDeclaration()
-|
-  UnmodifiedInterfaceDeclaration()
-}
-
-void LocalVariableDeclaration() :
-{}
-{
-  [ "final" { parser2.add(J_FINAL,token); } ]
-    Type() VariableDeclarator() ( "," VariableDeclarator() )*
-}
-
-void EmptyStatement() :
-{}
-{
-  ";"
-}
-
-void 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.
- */
-{}
-{
-  PreIncrementExpression()
-|
-  PreDecrementExpression()
-|
-  PrimaryExpression()
-  [
-    "++"                                 { parser2.add(J_DECINC,token); }
-  |
-    "--"                                 { parser2.add(J_DECINC,token); }
-  |
-    AssignmentOperator() Expression()
-  ]
-}
-
-void SwitchStatement() :
-{}
-{
-  "switch"                          { parser2.add(J_SWITCH_BEGIN,token); }
-  "(" Expression() ")" "{"
-    ( SwitchLabel()                 { parser2.add(J_CASE,token); }
-      ( BlockStatement() )* )*
-  "}"                               { parser2.add(J_SWITCH_END,token); }
-}
-
-void SwitchLabel() :
-{}
-{
-  "case" Expression() ":"
-|
-  "default" ":"
-}
-
-void 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.
- */
-{}
-{
-  "if"                              { parser2.add(J_IF_BEGIN,token); }
-     "(" Expression() ")" Statement()
-  [ LOOKAHEAD(1) "else"             { parser2.add(J_ELSE,token); }
-	     Statement() ]
-                                    { parser2.add(J_IF_END,token); }
-}
-
-void WhileStatement() :
-{}
-{
-  "while"                           { parser2.add(J_WHILE_BEGIN,token); }
-   "(" Expression() ")"Statement()  { parser2.add(J_WHILE_END,token); }
-}
-
-void DoStatement() :
-{}
-{
-  "do"                              { parser2.add(J_DO_BEGIN,token); }
-  Statement() "while" "(" Expression() ")" ";"
-                                    { parser2.add(J_DO_END,token); }
-}
-
-void ForStatement() :
-{}
-{
-  "for"                             { parser2.add(J_FOR_BEGIN,token); }
-    "(" [ ForInit() ] ";" [ Expression() ] ";" [ ForUpdate() ] ")" Statement()
-                                    { parser2.add(J_FOR_END,token); }
-}
-
-void ForInit() :
-{}
-{
-  LOOKAHEAD( [ "final" ] Type() <IDENTIFIER> )
-  LocalVariableDeclaration()
-|
-  StatementExpressionList()
-}
-
-void StatementExpressionList() :
-{}
-{
-  StatementExpression() ( "," StatementExpression() )*
-}
-
-void ForUpdate() :
-{}
-{
-  StatementExpressionList()
-}
-
-void BreakStatement() :
-{}
-{
-  "break"                           { parser2.add(J_BREAK,token); }
-  [ <IDENTIFIER> ] ";"
-}
-
-void ContinueStatement() :
-{}
-{
-  "continue"                        { parser2.add(J_CONTINUE,token); }
-  [ <IDENTIFIER> ] ";"
-}
-
-void ReturnStatement() :
-{}
-{
-  "return"                          { parser2.add(J_RETURN,token); }
-  [ Expression() ] ";"
-}
-
-void ThrowStatement() :
-{}
-{
-  "throw"                           { parser2.add(J_THROW,token); }
-  Expression() ";"
-}
-
-void SynchronizedStatement() :
-{}
-{
-  "synchronized"                    { parser2.add(J_SYNC_BEGIN,token); }
-  "(" Expression() ")" Block()      { parser2.add(J_SYNC_END,token); }
-}
-
-void TryStatement() :
-/*
- * Semantic check required here to make sure that at least one
- * finally/catch is present.
- */
-{}
-{
-  "try"                             { parser2.add(J_TRY_BEGIN,token); }
-  Block()
-  ( "catch"                         { parser2.add(J_CATCH_BEGIN,token); }
-    "(" FormalParameter() ")" Block() )*
-  [ "finally"                       { parser2.add(J_FINALLY,token); }
-   Block() ]                        { parser2.add(J_CATCH_END,token); }
-}
-
-
-

+ 0 - 39
jplag.frontend.java-1.2/Readme.txt

@@ -1,39 +0,0 @@
-JPlag Frontend Pack
-
-The JPlag system uses different frontends to transform the input files into a
-token stream, which abstracts very much from the original source code. For
-example in our Java frontend any assignments are translated to J_ASSIGN
-tokens, method invocations become J_APPLY tokens, arithmetic calculations,
-names, and comments are ignored, etc. Only some kind of program structure
-remains, which is then compared to other source files.
-
-This package contains a minimal set of files required to build our 
-Java 1.4 frontend (including ANTLR 2.7.7). The de.jplag.JPlag class has been
-reduced to only two functions.
-The grammar is specified with ANTLR 2.7.7 (src/main/antlr/java.g). In 
-some productions the parser adds tokens to the above mentioned token stream. 
-Search for "parser.add(" to find these locations. The token types are defined
-in "src/main/java/de/jplag/java/JavaToken.java" and "src/main/java/de/jplag/java/JavaTokenConstants.java".
-
-After building the source with a simple "mvn compile", you can test the parser by 
-invoking the main method of de.jplag.java.Parser with a Java file to parse as arguemtn:
-
-java -cp "antlr.jar;build" de.jplag.java.Parser src/main/java/de/jplag/java/Parser.java
-
-This will show you the listing of src/main/java/de/jplag/java/Parser.java on the right side 
-of the screen with the generated tokens and their locations on the left side.
-
-To generate a new frontend you have to do the following things:
-- Generate an ANTLR 2.7.7 grammar (note: ANTLR 3 is quite different
-  from ANTLR 2) -> this is done during mvn compile
-- Choose which tokens should be generated
-- Declare the token types in a ...Token.java and ...TokenConstants.java file
-- Add the tokens with "parser.add(..." in the grammar
-- Adapt the other files
-
-I hope this helps you to understand, how our frontends work and to create 
-your own frontend.
-
-It is also possible to use another parser generator. Our Java 1.5 frontend
-for example uses JavaCC 3.2. If you are interested in using JavaCC, we can
-also provide you with the Java 1.5 frontend.

+ 0 - 82
jplag.frontend.java-1.2/pom.xml

@@ -1,82 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <artifactId>java-1.2</artifactId>
-  <version>0.0.1-SNAPSHOT</version>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>build-helper-maven-plugin</artifactId>
-        <version>3.2.0</version>
-        <configuration>
-          <sources>
-            <source>src/main/antlr</source>
-            <source>target/generated-sources/antlr</source>
-          </sources>
-        </configuration>
-        <executions>
-          <execution>
-            <id>add-antlr-source</id>
-            <phase>generate-sources</phase>
-            <goals>
-              <goal>add-source</goal>
-            </goals>
-
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>antlr-maven-plugin</artifactId>
-        <version>2.2</version>
-        <configuration>
-          <!-- Comma separated list of grammar files or pattern grammar files 
-            By default, grammar file(s) is in ${basedir}/src/main/antlr -->
-          <grammars>java.g</grammars>
-          <!-- <grammars>*.g</grammars> -->
-        </configuration>
-        <executions>
-          <execution>
-            <goals>
-              <goal>generate</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-jar-plugin</artifactId>
-        <configuration>
-          <archive>
-            <manifest>
-              <mainClass>de.jplag.java.Parser</mainClass>
-              <packageName>jplag.java</packageName>
-            </manifest>
-          </archive>
-        </configuration>
-      </plugin>
-
-    </plugins>
-  </build>
-
-  <dependencies>
-    <dependency>
-      <groupId>antlr</groupId>
-      <artifactId>antlr</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>de.jplag</groupId>
-      <artifactId>frontend-utils</artifactId>
-    </dependency>
-  </dependencies>
-  <parent>
-    <groupId>de.jplag</groupId>
-    <artifactId>parent</artifactId>
-    <version>0.3-SNAPSHOT</version>
-    <relativePath>../jplag.parent/pom.xml</relativePath>
-  </parent>
-</project>

+ 0 - 1272
jplag.frontend.java-1.2/src/main/antlr/java.g

@@ -1,1272 +0,0 @@
-header {
-  package de.jplag.java.grammar;
-  
-  import java.io.IOException;
-  import de.jplag.java.*;
-  import de.jplag.InputState;
-  import de.jplag.ParserToken;
-}
-
-/** Java 1.2 Recognizer
- *
- * Run 'java Main <directory full of java files>'
- *
- * Contributing authors:
- *		John Mitchell		johnm@non.net
- *		Terence Parr		parrt@magelang.com
- *		John Lilley			jlilley@empathy.com
- *		Scott Stanchfield	thetick@magelang.com
- *		Markus Mohnen       mohnen@informatik.rwth-aachen.de
- *		Peter Williams		pwilliams@netdynamics.com
- *
- * Version 1.00 December 9, 1997 -- initial release
- * Version 1.01 December 10, 1997
- *		fixed bug in octal def (0..7 not 0..8)
- * Version 1.10 August 1998 (parrt)
- *		added tree construction
- *		fixed definition of WS,comments for mac,pc,unix newlines
- *		added unary plus
- * Version 1.11 (Nov 20, 1998)
- *		Added "shutup" option to turn off last ambig warning.
- *		Fixed inner class def to allow named class defs as statements
- *		synchronized requires compound not simple statement
- *		add [] after builtInType DOT class in primaryExpression
- *		"const" is reserved but not valid..removed from modifiers
- * Version 1.12 (Feb 2, 1999)
- *		Changed LITERAL_xxx to xxx in tree grammar.
- *		Updated java.g to use tokens {...} now for 2.6.0 (new feature).
- *
- * Version 1.13 (Apr 23, 1999)
- *		Didn't have (stat)? for else clause in tree parser.
- *		Didn't gen ASTs for interface extends.  Updated tree parser too.
- *		Updated to 2.6.0.
- * Version 1.14 (Jun 20, 1999)
- *		Allowed final/abstract on local classes.
- *		Removed local interfaces from methods
- *		Put instanceof precedence where it belongs...in relationalExpr
- *			It also had expr not type as arg; fixed it.
- *		Missing ! on SEMI in classBlock
- *		fixed: (expr) + "string" was parsed incorrectly (+ as unary plus).
- *		fixed: didn't like Object[].class in parser or tree parser
- * Version 1.15 (Jun 26, 1999)
- *		Screwed up rule with instanceof in it. :(  Fixed.
- *		Tree parser didn't like (expr).something; fixed.
- *		Allowed multiple inheritance in tree grammar. oops.
- * Version 1.16 (August 22, 1999)
- *		Extending an interface built a wacky tree: had extra EXTENDS.
- *		Tree grammar didn't allow multiple superinterfaces.
- *		Tree grammar didn't allow empty var initializer: {}
- * Version 1.17 (October 12, 1999)
- *		ESC lexer rule allowed 399 max not 377 max.
- *		java.tree.g didn't handle the expression of synchronized
- *			statements.
- *
- * Version tracking now done with following ID:
- *
- * $Id: //depot/code/org.antlr/release/antlr-2.7.0/examples/java/java/java.g#1 $
- *
- * BUG:
- * 		Doesn't like boolean.class!
- *
- * class Test {
- *   public static void main( String args[] ) {
- *     if (boolean.class.equals(boolean.class)) {
- *       System.out.println("works");
- *     }
- *   }
- * }
- *
- * This grammar is in the PUBLIC DOMAIN
- */
-
-class JRecognizer extends Parser;
-options {
-  k = 2;                           // two token lookahead
-  exportVocab=J;                   // Call its vocabulary "Java"
-  codeGenMakeSwitchThreshold = 2;  // Some optimizations
-  codeGenBitsetTestThreshold = 3;
-  defaultErrorHandler = false;     // Don't generate parser error handlers
-  buildAST = false;
-  ASTLabelType = "ParserToken";
-  classHeaderSuffix = "JavaTokenConstants";
-}
-
-tokens {
-  BLOCK; MODIFIERS; OBJBLOCK; SLIST; CTOR_DEF; METHOD_DEF; VARIABLE_DEF; 
-  INSTANCE_INIT; STATIC_INIT; TYPE; CLASS_DEF; INTERFACE_DEF; 
-  PACKAGE_DEF; ARRAY_DECLARATOR; EXTENDS_CLAUSE; IMPLEMENTS_CLAUSE;
-  PARAMETERS; PARAMETER_DEF; LABELED_STAT; TYPECAST; INDEX_OP; 
-  POST_INC; POST_DEC; METHOD_CALL; EXPR; ARRAY_INIT; 
-  IMPORT; UNARY_MINUS; UNARY_PLUS; CASE_GROUP; ELIST; FOR_INIT; FOR_CONDITION; 
-  FOR_ITERATOR; EMPTY_STAT; FINAL="final"; ABSTRACT="abstract";
-}
-	
-	// Emeric 13.01.05 feld de.jplag.java.Parser parser
-	
-	{public de.jplag.java.Parser parser ;}
-	
-// Compilation Unit: In Java, this is a single file.  This is the start
-//   rule for this parser
-compilationUnit
-	:      // A compilation unit starts with an optional package definition
-		(	packageDefinition
-		|	/* nothing */
-		)
-
-		// Next we have a series of zero or more import statements
-		( importDefinition )*
-
-		// Wrapping things up with any number of class or interface
-		//    definitions
-		( typeDefinition )*
-
-		EOF
-	;
-
-
-// Package statement: "package" followed by an identifier.
-packageDefinition
-	options {defaultErrorHandler = true;} // let ANTLR handle errors
-	:	p:"package"^ identifier SEMI!
-                { parser.add(J_PACKAGE, p); }
-	;
-
-
-// Import statement: import followed by a package or class name
-importDefinition
-	options {defaultErrorHandler = true;}
-	:	i:"import"^ identifierStar SEMI!
-                { parser.add(J_IMPORT, i); }
-	;
-
-// A type definition in a file is either a class or interface definition.
-typeDefinition
-//	options {defaultErrorHandler = true;}
-        { Token end = null; }
-	:	modifiers!
-		( end=classDefinition
-		| interfaceDefinition
-		)
-	|	SEMI!
-	;
-
-/** A declaration is the creation of a reference or primitive-type variable
- *  Create a separate Type/Var tree for each var in the var list.
- */
-declaration!
-	:	m:modifiers t:typeSpec v:variableDefinitions
-        ;
-
-// A list of zero or more modifiers.  We could have used (modifier)* in
-//   place of a call to modifiers, but I thought it was a good idea to keep
-//   this rule separate so they can easily be collected in a Vector if
-//   someone so desires
-modifiers
-	:	( modifier )*
-	;
-
-
-// A type specification is a type name with possible brackets afterwards
-//   (which would make it an array type).
-typeSpec
-	: classTypeSpec
-	| builtInTypeSpec
-	;
-
-// A class type specification is a class type with possible brackets afterwards
-//   (which would make it an array type).
-classTypeSpec
-	:	identifier (lb:LBRACK^ RBRACK!)*
-	;
-
-// A builtin type specification is a builtin type with possible brackets
-// afterwards (which would make it an array type).
-builtInTypeSpec
-	:	builtInType (lb:LBRACK^ RBRACK!)*
-	;
-
-// A type name. which is either a (possibly qualified) class name or
-//   a primitive (builtin) type
-type
-	:	identifier
-	|	builtInType
-	;
-
-// The primitive types.
-builtInType
-	:	v:"void"
-                { parser.add(J_VOID, v); }
-	|	"boolean"
-	|	"byte"
-	|	"char"
-	|	"short"
-	|	"int"
-	|	"float"
-	|	"long"
-	|	"double"
-	;
-
-// A (possibly-qualified) java identifier.  We start with the first IDENT
-//   and expand its name by adding dots and following IDENTS
-identifier
-	:	IDENT  ( DOT^ IDENT )*
-	;
-
-identifierStar
-	:	IDENT
-		( DOT^ IDENT )*
-		( DOT^ STAR  )?
-	;
-
-
-// modifiers for Java classes, interfaces, class/instance vars and methods
-modifier
-	:	"private"
-	|	"public"
-	|	"protected"
-	|	"static"
-	|	"transient"
-	|	"final"
-	|	"abstract"
-	|	"native"
-	|	"threadsafe"
-	|	"synchronized"
-//	|	"const"			// reserved word; leave out
-	|	"volatile"
-	;
-
-
-// Definition of a Java class
-classDefinition! returns [Token end]
-{ end = null; }
-	:	c:"class" IDENT
-                { parser.add(J_CLASS_BEGIN, c); }
-		// it _might_ have a superclass...
-		sc:superClassClause
-		// it might implement some interfaces...
-		ic:implementsClause
-		// now parse the body of the class
-		end=classBlock
-                { parser.add(J_CLASS_END, end); }
-	;
-
-superClassClause!
-	:	( "extends" id:identifier )?
-	;
-
-// Definition of a Java Interface
-interfaceDefinition!
-{ Token end = null; }
-	:	i:"interface" IDENT
-                { parser.add(J_INTERFACE_BEGIN, i); }
-		// it might extend some other interfaces
-		ie:interfaceExtends
-		// now parse the body of the interface (looks like a class...)
-		end=classBlock
-                { parser.add(J_INTERFACE_END, end); }
-	;
-
-
-// This is the body of a class.  You can have fields and extra semicolons,
-// That's about it (until you see what a field is...)
-classBlock returns [Token end]
-{ end = null; }
-	:	LCURLY!
-			( field | SEMI! )*
-		b:RCURLY
-                { end = b; }
-	;
-
-// special case:
-innerClassBlock
-	:	lc:LCURLY!
-                { parser.add(J_IN_CLASS_BEGIN, lc); }
-			( field | SEMI! )*
-		rc:RCURLY
-                { parser.add(J_IN_CLASS_END, rc); }
-	;
-
-// An interface can extend several other interfaces...
-interfaceExtends
-	:	(
-		e:"extends"!
-		identifier ( COMMA! identifier )*
-		)?
-	;
-
-// A class can implement several interfaces...
-implementsClause
-	:	(
-			i:"implements"! identifier ( COMMA! identifier )*
-		)?
-	;
-
-// Now the various things that can be defined inside a class or interface...
-// Note that not all of these are really valid in an interface (constructors,
-//   for example), and if this grammar were used for a compiler there would
-//   need to be some semantic checks to make sure we're doing the right thing...
-field!
-{ Token end = null; }
-	:	// method, constructor, or variable declaration
-		mods:modifiers
-		(	h:ctorHead end=compoundStatement  // constructor
-		        { parser.add(J_CONSTR_END, end); }
-		|	end=classDefinition              // inner class
-		|	interfaceDefinition          // inner interface
-		|	typeSpec  // method or variable declaration(s)
-			(	id:IDENT  // the name of the method
-			        { parser.add(J_METHOD_BEGIN, id); }
-				// parse the formal parameter declarations.
-				LPAREN! param:parameterDeclarationList RPAREN!
-
-				rt:returnTypeBrackersOnEndOfMethodHead
-
-				// get the list of exceptions that this method is declared to throw
-				(tc:throwsClause)?
-
-				( end=compoundStatement
-				  { parser.add(J_METHOD_END, end); }
-				| s:SEMI
-				  { parser.add(J_METHOD_END, s); }
-				)
-			|	v:variableDefinitions SEMI
-			)
-		)
-
-    // "static { ... }" class initializer
-	|	s2:"static"
-                { parser.add(J_INIT_BEGIN, s2); }
-                end=compoundStatement
-                { parser.add(J_INIT_END, end); }
-
-    // "{ ... }" instance initializer
-	|	initCompoundStatement
-	;
-
-variableDefinitions
-	:	variableDeclarator
-		(	COMMA!
-			variableDeclarator
-		)*
-	;
-
-/** Declaration of a variable.  This can be a class/instance variable,
- *   or a local variable in a method
- * It can also include possible initialization.
- */
-variableDeclarator!
-	:	id:IDENT
-                { parser.add(J_VARDEF, id); }
-                d:declaratorBrackets v:varInitializer
-	;
-
-declaratorBrackets
-	:	
-		(lb:LBRACK^ RBRACK!)*
-	;
-
-varInitializer
-	:	( ass:ASSIGN^
-                { parser.add(J_ASSIGN, ass); }
-		  initializer )?
-	;
-
-// This is an initializer used to set up an array.
-arrayInitializer
-	:	lc:LCURLY
-                { parser.add(J_ARRAY_INIT_BEGIN, lc); }
-			(	initializer
-				(
-		    // CONFLICT: does a COMMA after an initializer start a new
-		    //           initializer or start the option ',' at end?
-		    //           ANTLR generates proper code by matching
-		    //			 the comma as soon as possible.
-					options {
-						warnWhenFollowAmbig = false;
-					}
-				:
-					COMMA! initializer
-				)*
-				(COMMA!)?
-			)?
-		rc:RCURLY
-                { parser.add(J_ARRAY_INIT_END, rc); }
-	;
-
-
-// The two "things" that can initialize an array element are an expression
-//   and another (nested) array initializer.
-initializer
-	:	expression
-	|	arrayInitializer
-	;
-
-// This is the header of a method.  It includes the name and parameters
-//   for the method.
-//   This also watches for a list of exception classes in a "throws" clause.
-ctorHead
-	:	id:IDENT  // the name of the method
-                { parser.add(J_CONSTR_BEGIN, id); }
-
-		// parse the formal parameter declarations.
-		LPAREN! parameterDeclarationList RPAREN!
-
-		// get the list of exceptions that this method is declared to throw
-		(throwsClause)?
-	;
-
-// This is a list of exception classes that the method is declared to throw
-throwsClause
-	:	"throws"^ identifier ( COMMA! identifier )*
-	;
-
-
-returnTypeBrackersOnEndOfMethodHead
-	:	
-		(lb:LBRACK^ RBRACK!)*
-	;
-
-// A list of formal parameters
-parameterDeclarationList
-	:	( parameterDeclaration ( COMMA! parameterDeclaration )* )?
-	;
-
-// A formal parameter.
-parameterDeclaration!
-	:	pm:parameterModifier t:typeSpec id:IDENT
-		pd:parameterDeclaratorBrackets
-	;
-
-parameterDeclaratorBrackets
-	:	
-		(lb:LBRACK^ RBRACK!)*
-	;
-
-parameterModifier
-	:	(f:"final")?
-	;
-
-// Compound statement.  This is used in many contexts:
-//   Inside a class definition prefixed with "static":
-//      it is a class initializer
-//   Inside a class definition without "static":
-//      it is an instance initializer
-//   As the body of a method
-//   As a completely indepdent braced block of code inside a method
-//      it starts a new scope for variable definitions
-
-compoundStatement returns [Token end]
-{ end = null; }
-	:	lc:LCURLY^
-			// include the (possibly-empty) list of statements
-			(end=statement)*
-		rc:RCURLY
-                { end = rc; }
-	;
-
-// special rule...
-initCompoundStatement
-{ Token end = null; }
-	:	lc:LCURLY^
-                { parser.add(J_INIT_BEGIN, lc); }
-                // include the (possibly-empty) list of statements
-                (end=statement)*
-		rc:RCURLY
-                { parser.add(J_INIT_END, rc); }
-	;
-
-
-statement returns [Token end]
-{ end = null; }
-	// A list of statements in curly braces -- start a new scope!
-	:	end=compoundStatement
-
-	// class definition
-	|	end=classDefinition
-
-	// final class definition
-	|	"final"! end=classDefinition
-
-	// abstract class definition
-	|	"abstract"! end=classDefinition
-
-	// declarations are ambiguous with "ID DOT" relative to expression
-	// statements.  Must backtrack to be sure.  Could use a semantic
-	// predicate to test symbol table to see what the type was coming
-	// up, but that's pretty hard without a symbol table ;)
-	|	(declaration)=> declaration s1:SEMI    { end = s1; }
-
-	// An expression statement.  This could be a method call,
-	// assignment statement, or any other expression evaluated for
-	// side-effects.
-        |	expression s2:SEMI     { end = s2; }
-
-	// Attach a label to the front of a statement
-	|	IDENT COLON^ end=statement
-
-	// If-else statement
-	|	i1:"if"^
-                { parser.add(J_IF_BEGIN, i1); }
-	        LPAREN! expression RPAREN! end=statement
-		(
-			// CONFLICT: the old "dangling-else" problem...
-			//           ANTLR generates proper code matching
-			//			 as soon as possible.  Hush warning.
-			options {
-				warnWhenFollowAmbig = false;
-			}
-		:
-			e1:"else"!
-                        { parser.add(J_ELSE, e1); }
-			end=statement
-		)?
-                { parser.add(J_IF_END, end); }
-
-	// For statement
-	|	f1:"for"^
-                { parser.add(J_FOR_BEGIN, f1); }
-			LPAREN!
-				forInit SEMI!   // initializer
-				forCond	SEMI!   // condition test
-				forIter         // updater
-			RPAREN!
-			end=statement                 // statement to loop over
-                { parser.add(J_FOR_END, end); }
-
-	// While statement
-	|	w1:"while"^
-                { parser.add(J_WHILE_BEGIN, w1); }
-	        LPAREN! expression RPAREN!
-		end=statement
-                { parser.add(J_WHILE_END, end); }
-
-	// do-while statement
-	|	d1:"do"^
-                { parser.add(J_DO_BEGIN, d1); }
-	        end=statement "while"! LPAREN! expression RPAREN!
-		s3:SEMI
-                { parser.add(J_DO_END, end=s3); }
-
-	// get out of a loop (or switch)
-	|	b1:"break"^
-                { parser.add(J_BREAK, b1); }
-                (IDENT)? s4:SEMI       { end = s4; }
-
-	// do next iteration of a loop
-	|	c1:"continue"^
-                { parser.add(J_CONTINUE, c1); }
-                (IDENT)? s5:SEMI       { end = s5; }
-
-	// Return an expression
-	|	r1:"return"^
-                { parser.add(J_RETURN, r1); }
-                (expression)? s6:SEMI  { end = s6; }
-
-	// switch/case statement
-	|	s7:"switch"^
-                { parser.add(J_SWITCH_BEGIN, s7); }
-                LPAREN! expression RPAREN! LCURLY!
-		    ( casesGroup )*
-		rc:RCURLY
-                { parser.add(J_SWITCH_END, end=rc); }
-
-	// exception try-catch block
-	|	end=tryBlock
-
-	// throw an exception
-	|	t1:"throw"^
-                { parser.add(J_THROW, t1); }
-                expression s8:SEMI     { end = s8; }
-
-	// synchronize a statement
-	|	s9:"synchronized"^
-                { parser.add(J_SYNC_BEGIN, s9); }
-                LPAREN! expression RPAREN!
-		end=compoundStatement
-                { parser.add(J_SYNC_END, end); }
-
-
-	// empty statement
-        |	s10:SEMI               { end = s10; }
-	;
-
-
-casesGroup
-	:	(	// CONFLICT: to which case group do the statements bind?
-			//           ANTLR generates proper code: it groups the
-			//           many "case"/"default" labels together then
-			//           follows them with the statements
-			options {
-				warnWhenFollowAmbig = false;
-			}
-			:
-			aCase
-		)+
-		caseSList
-	;
-
-aCase
-	:	( c:"case"^
-                  { parser.add(J_CASE, c); }
-	          expression
-		| d:"default"
-                  { parser.add(J_CASE, d); }
-                ) COLON!
-	;
-
-caseSList
-{ Token end = null; }
-	:	(end=statement)*
-	;
-
-// The initializer for a for loop
-forInit
-		// if it looks like a declaration, it is
-	:	(	(declaration)=> declaration
-		// otherwise it could be an expression list...
-		|	expressionList
-		)?
-	;
-
-forCond
-	:	(expression)?
-	;
-
-forIter
-	:	(expressionList)?
-	;
-
-// an exception handler try/catch block
-tryBlock returns [Token end]
-{ end = null; }
-	:	t:"try"^
-                { parser.add(J_TRY_BEGIN, t); }
-	        end=compoundStatement
-		(end=handler)*
-		( f:"finally"^
-                  { parser.add(J_FINALLY, f); }
-		  end=compoundStatement )?
-                { parser.add(J_CATCH_END, end); }
-	;
-
-
-// an exception handler
-handler returns [Token end]
-{ end = null; }
-	:	c:"catch"^
-                { parser.add(J_CATCH_BEGIN, c); }
-	        LPAREN! parameterDeclaration RPAREN!
-	        end=compoundStatement
-	;
-
-
-// expressions
-// Note that most of these expressions follow the pattern
-//   thisLevelExpression :
-//       nextHigherPrecedenceExpression
-//           (OPERATOR nextHigherPrecedenceExpression)*
-// which is a standard recursive definition for a parsing an expression.
-// The operators in java have the following precedences:
-//    lowest  (13)  = *= /= %= += -= <<= >>= >>>= &= ^= |=
-//            (12)  ?:
-//            (11)  ||
-//            (10)  &&
-//            ( 9)  |
-//            ( 8)  ^
-//            ( 7)  &
-//            ( 6)  == !=
-//            ( 5)  < <= > >=
-//            ( 4)  << >>
-//            ( 3)  +(binary) -(binary)
-//            ( 2)  * / %
-//            ( 1)  ++ -- +(unary) -(unary)  ~  !  (type)
-//                  []   () (method call)  . (dot -- identifier qualification)
-//                  new   ()  (explicit parenthesis)
-//
-// the last two are not usually on a precedence chart; I put them in
-// to point out that new has a higher precedence than '.', so you
-// can validy use
-//     new Frame().show()
-// 
-// Note that the above precedence levels map to the rules below...
-// Once you have a precedence chart, writing the appropriate rules as below
-//   is usually very straightfoward
-
-
-
-// the mother of all expressions
-expression
-	:	assignmentExpression
-	;
-
-
-// This is a list of expressions.
-expressionList
-	:	expression (COMMA! expression)*
-	;
-
-
-// assignment expression (level 13)
-assignmentExpression
-  :	conditionalExpression
-  (	(   a:ASSIGN^               { parser.add(J_ASSIGN, a); }
-	|   a2:PLUS_ASSIGN^         { parser.add(J_ASSIGN, a2); }
-	|   a3:MINUS_ASSIGN^        { parser.add(J_ASSIGN, a3); }
-	|   a4:STAR_ASSIGN^         { parser.add(J_ASSIGN, a4); }
-	|   a5:DIV_ASSIGN^          { parser.add(J_ASSIGN, a5); }
-	|   a6:MOD_ASSIGN^          { parser.add(J_ASSIGN, a6); }
-	|   a7:SR_ASSIGN^           { parser.add(J_ASSIGN, a7); }
-	|   a8:BSR_ASSIGN^          { parser.add(J_ASSIGN, a8); }
-        |   a9:SL_ASSIGN^           { parser.add(J_ASSIGN, a9); }
-        |   aa:BAND_ASSIGN^         { parser.add(J_ASSIGN, aa); }
-        |   ab:BXOR_ASSIGN^         { parser.add(J_ASSIGN, ab); }
-        |   ac:BOR_ASSIGN^          { parser.add(J_ASSIGN, ac); }
-        )
-	assignmentExpression
-   )?
-;
-
-
-// conditional test (level 12)
-conditionalExpression
-	:	logicalOrExpression
-		( q:QUESTION^
-                  { parser.add(J_COND, q); }
-		  assignmentExpression COLON! conditionalExpression )?
-	;
-
-
-// logical or (||)  (level 11)
-logicalOrExpression
-	:	logicalAndExpression (LOR^ logicalAndExpression)*
-	;
-
-
-// logical and (&&)  (level 10)
-logicalAndExpression
-	:	inclusiveOrExpression (LAND^ inclusiveOrExpression)*
-	;
-
-
-// bitwise or non-short-circuiting or (|)  (level 9)
-inclusiveOrExpression
-	:	exclusiveOrExpression (BOR^ exclusiveOrExpression)*
-	;
-
-
-// exclusive or (^)  (level 8)
-exclusiveOrExpression
-	:	andExpression (BXOR^ andExpression)*
-	;
-
-
-// bitwise or non-short-circuiting and (&)  (level 7)
-andExpression
-	:	equalityExpression (BAND^ equalityExpression)*
-	;
-
-
-// equality/inequality (==/!=) (level 6)
-equalityExpression
-	:	relationalExpression ((NOT_EQUAL^ | EQUAL^) relationalExpression)*
-	;
-
-
-// boolean relational expressions (level 5)
-relationalExpression
-	:	shiftExpression
-		(	(	(	LT^
-				|	GT^
-				|	LE^
-				|	GE^
-				)
-				shiftExpression
-			)*
-		|	"instanceof"^ typeSpec
-		)
-	;
-
-
-// bit shift expressions (level 4)
-shiftExpression
-	:	additiveExpression ((SL^ | SR^ | BSR^) additiveExpression)*
-	;
-
-
-// binary addition/subtraction (level 3)
-additiveExpression
-	:	multiplicativeExpression ((PLUS^ | MINUS^) multiplicativeExpression)*
-	;
-
-
-// multiplication/division/modulo (level 2)
-multiplicativeExpression
-	:	unaryExpression ((STAR^ | DIV^ | MOD^ ) unaryExpression)*
-	;
-
-unaryExpression
-	:	i:INC^ unaryExpression
-                  { parser.add(J_ASSIGN, i); }
-	|	d:DEC^ unaryExpression
-                  { parser.add(J_ASSIGN, d); }
-	|	MINUS^ unaryExpression
-	|	PLUS^ unaryExpression
-	|	unaryExpressionNotPlusMinus
-	;
-
-unaryExpressionNotPlusMinus
-	:	BNOT^ unaryExpression
-	|	LNOT^ unaryExpression
-
-	|	(	// subrule allows option to shut off warnings
-			options {
-				// "(int" ambig with postfixExpr due to lack of sequence
-				// info in linear approximate LL(k).  It's ok.  Shut up.
-				generateAmbigWarnings=false;
-			}
-		:	// If typecast is built in type, must be numeric operand
-			// Also, no reason to backtrack if type keyword like int, float...
-			lpb:LPAREN^ builtInTypeSpec RPAREN!
-			unaryExpression
-
-			// Have to backtrack to see if operator follows.  If no operator
-			// follows, it's a typecast.  No semantic checking needed to parse.
-			// if it _looks_ like a cast, it _is_ a cast; else it's a "(expr)"
-		|	(LPAREN classTypeSpec RPAREN unaryExpressionNotPlusMinus)=>
-			lp:LPAREN^ classTypeSpec RPAREN!
-			unaryExpressionNotPlusMinus
-
-		|	postfixExpression
-		)
-	;
-
-// qualified names, array expressions, method invocation, post inc/dec
-postfixExpression
-{ Token id = null; }
-	:	id=primaryExpression // start with a primary
-
-		(	// qualified id (id.id.id.id...) -- build the name
- 		        DOT^ ( i:IDENT { id = i; }
-			     | t:"this" { id = t; }
-			     | c:"class" { id = c; }
-			     | id=newExpression
-			     | s:"super" LPAREN ( expressionList )? RPAREN
-                               { id = s; }
-                 | "super" DOT^ i2:IDENT { id = i2; }
-			     )
-			// the above line needs a semantic check to make sure "class"
-			//   is the _last_ qualifier.
-
-			// allow ClassName[].class
-		|	( lbc:LBRACK^ RBRACK! )+
-			DOT^ "class"
-
-			// an array indexing operation
-		|	lb:LBRACK^ expression RBRACK!
-
-			// method invocation
-			// The next line is not strictly proper; it allows x(3)(4) or
-			//  x[2](4) which are not valid in Java.  If this grammar were used
-			//  to validate a Java program a semantic check would be needed, or
-			//   this rule would get really ugly...
-		|	lp:LPAREN^
-		        { if (id == null) id = lp;
-                          parser.add(J_APPLY, id); }
-			argList
-			RPAREN!
-		)*
-
-		// possibly add on a post-increment or post-decrement.
-		// allows INC/DEC on too much, but semantics can check
-		(	in:INC^
-		        { parser.add(J_ASSIGN, in); }
-	 	|	de:DEC^
-                        { parser.add(J_ASSIGN, de); }
-		|	// nothing
-		)
-
-		// look for int.class and int[].class
-	|	builtInType 
-		( lbt:LBRACK^ RBRACK! )*
-		DOT^ "class"
-	;
-
-// the basic element of an expression
-primaryExpression returns [Token id]
-{id = null; }
-        :	i:IDENT           { id = i; }
-	|	id=newExpression
-	|	constant
-	|	s:"super"         { id = s; }
-	|	"true"
-	|	"false"
-	|	t:"this"          { id = t;} 
-	|	"null"
-	|	LPAREN! assignmentExpression RPAREN!
-	;
-
-/** object instantiation.
- *  Trees are built as illustrated by the following input/tree pairs:
- *  
- *  new T()
- *  
- *  new
- *   |
- *   T --  ELIST
- *           |
- *          arg1 -- arg2 -- .. -- argn
- *  
- *  new int[]
- *
- *  new
- *   |
- *  int -- ARRAY_DECLARATOR
- *  
- *  new int[] {1,2}
- *
- *  new
- *   |
- *  int -- ARRAY_DECLARATOR -- ARRAY_INIT
- *                                  |
- *                                EXPR -- EXPR
- *                                  |      |
- *                                  1      2
- *  
- *  new int[3]
- *  new
- *   |
- *  int -- ARRAY_DECLARATOR
- *                |
- *              EXPR
- *                |
- *                3
- *  
- *  new int[1][2]
- *  
- *  new
- *   |
- *  int -- ARRAY_DECLARATOR
- *               |
- *         ARRAY_DECLARATOR -- EXPR
- *               |              |
- *             EXPR             1
- *               |
- *               2
- *  
- */
-newExpression returns [Token id]
-{ id = null;
-  Token end = null;
-}
-        :	n:"new"^ type { id = n; }
-		(	
-                  { parser.add(J_NEWCLASS, n); }
-		  LPAREN! argList RPAREN!
-		  (innerClassBlock)?
-
-			//java 1.1
-			// Note: This will allow bad constructs like
-			//    new int[4][][3] {exp,exp}.
-			//    There needs to be a semantic check here...
-			// to make sure:
-			//   a) [ expr ] and [ ] are not mixed
-			//   b) [ expr ] and an init are not used together
-
-		|	{ parser.add(J_NEWARRAY, n); }
-		        newArrayDeclarator (arrayInitializer)?
-		)
-	;
-
-argList
-	:	(	expressionList
-		|	/*nothing*/
-		)
-	;
-
-newArrayDeclarator
-	:	(
-			// CONFLICT:
-			// newExpression is a primaryExpression which can be
-			// followed by an array index reference.  This is ok,
-			// as the generated code will stay in this loop as
-			// long as it sees an LBRACK (proper behavior)
-			options {
-				warnWhenFollowAmbig = false;
-			}
-		:
-			lb:LBRACK^
-				(expression)?
-			RBRACK!
-		)+
-	;
-
-constant
-	:	NUM_INT
-	|	CHAR_LITERAL
-	|	STRING_LITERAL
-	|	NUM_FLOAT
-	;
-
-
-//----------------------------------------------------------------------------
-// The Java scanner
-//----------------------------------------------------------------------------
-class JLexer extends Lexer;
-
-options {
-  exportVocab=J;      // call the vocabulary "Java"
-  testLiterals=false;    // don't automatically test for literals
-  k=4;                   // four characters of lookahead
-  charVocabulary = '\u0000'..'\u00ff';
-}
-
-{
-  public void newline() {
-    super.newline();
-    ((InputState)inputState).column = 1;
-  }
-  
-  public void consume() throws antlr.CharStreamException {
-    if ( inputState.guessing == 0 ) {
-      InputState state = (InputState)inputState;
-      if (text.length()==0) {
-	// remember token start column
-	state.tokColumn = state.column;
-      }
-      state.column++;
-    }
-    super.consume();
-  }
-  
-  protected Token makeToken(int t) {
-    ParserToken tok = (ParserToken)super.makeToken(t);
-    tok.setColumn(((InputState)inputState).tokColumn);
-    return tok;
-  }
-}
-
-
-// OPERATORS
-QUESTION		:	'?'		;
-LPAREN			:	'('		;
-RPAREN			:	')'		;
-LBRACK			:	'['		;
-RBRACK			:	']'		;
-LCURLY			:	'{'		;
-RCURLY			:	'}'		;
-COLON			:	':'		;
-COMMA			:	','		;
-//DOT			:	'.'		;
-ASSIGN			:	'='		;
-EQUAL			:	"=="	;
-LNOT			:	'!'		;
-BNOT			:	'~'		;
-NOT_EQUAL		:	"!="	;
-DIV				:	'/'		;
-DIV_ASSIGN		:	"/="	;
-PLUS			:	'+'		;
-PLUS_ASSIGN		:	"+="	;
-INC				:	"++"	;
-MINUS			:	'-'		;
-MINUS_ASSIGN	:	"-="	;
-DEC				:	"--"	;
-STAR			:	'*'		;
-STAR_ASSIGN		:	"*="	;
-MOD				:	'%'		;
-MOD_ASSIGN		:	"%="	;
-SR				:	">>"	;
-SR_ASSIGN		:	">>="	;
-BSR				:	">>>"	;
-BSR_ASSIGN		:	">>>="	;
-GE				:	">="	;
-GT				:	">"		;
-SL				:	"<<"	;
-SL_ASSIGN		:	"<<="	;
-LE				:	"<="	;
-LT				:	'<'		;
-BXOR			:	'^'		;
-BXOR_ASSIGN		:	"^="	;
-BOR				:	'|'		;
-BOR_ASSIGN		:	"|="	;
-LOR				:	"||"	;
-BAND			:	'&'		;
-BAND_ASSIGN		:	"&="	;
-LAND			:	"&&"	;
-SEMI			:	';'		;
-
-
-// Whitespace -- ignored
-WS	:
-  (	' '
-  |	'\t' //{ ((InputState)inputState).column += 7; }
-  |	'\f'
-  | '\u001a'
-  // handle newlines
-  |	(	"\r\n"  // Evil DOS
-	|	'\r'    // Macintosh
-	|	'\n'    // Unix (the right way)
-	) { newline(); }
-  ) { _ttype = Token.SKIP; }
-;
-
-// Single-line comments
-SL_COMMENT
-	:	"//"
-		(~('\n'|'\r'))* ('\n'|'\r'('\n')?)?
-		{$setType(Token.SKIP); newline();}
-	;
-
-// multiple-line comments
-ML_COMMENT :   
-  "/*"
-  (	/*	'\r' '\n' can be matched in one alternative or by matching
-		'\r' in one iteration and '\n' in another.  I am trying to
-		handle any flavor of newline that comes in, but the language
-		that allows both "\r\n" and "\r" and "\n" to all be valid
-		newline is ambiguous.  Consequently, the resulting grammar
-		must be ambiguous.  I'm shutting this warning off.
-	*/
-   options { generateAmbigWarnings=false; } : { LA(2)!='/' }? '*'
-  |	'\r' '\n'		{newline();}
-  |	'\r'			{newline();}
-  |	'\n'			{newline();}
-  |	~('*'|'\n'|'\r')
-   )*
-  "*/" {$setType(Token.SKIP);}
-;
-
-
-// character literals
-CHAR_LITERAL
-	:	'\'' ( ESC | ~'\'' ) '\''
-	;
-
-// string literals
-STRING_LITERAL
-	:	'"' (ESC|~('"'|'\\'))* '"'
-	;
-
-
-// escape sequence -- note that this is protected; it can only be called
-//   from another lexer rule -- it will not ever directly return a token to
-//   the parser
-// There are various ambiguities hushed in this rule.  The optional
-// '0'...'9' digit matches should be matched here rather than letting
-// them go back to STRING_LITERAL to be matched.  ANTLR does the
-// right thing by matching immediately; hence, it's ok to shut off
-// the FOLLOW ambig warnings.
-protected
-ESC
-	:	'\\'
-		(	'n'
-		|	'r'
-		|	't'
-		|	'b'
-		|	'f'
-		|	'"'
-		|	'\''
-		|	'\\'
-		|	('u')+ HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT 
-		|	('0'..'3')
-			(
-				options {
-					warnWhenFollowAmbig = false;
-				}
-			:	('0'..'7')
-				(	
-					options {
-						warnWhenFollowAmbig = false;
-					}
-				:	'0'..'7'
-				)?
-			)?
-		|	('4'..'7')
-			(
-				options {
-					warnWhenFollowAmbig = false;
-				}
-			:	('0'..'9')
-			)?
-		)
-	;
-
-
-// hexadecimal digit (again, note it's protected!)
-protected
-HEX_DIGIT
-	:	('0'..'9'|'A'..'F'|'a'..'f')
-	;
-
-
-// a dummy rule to force vocabulary to be all characters (except special
-//   ones that ANTLR uses internally (0 to 2)
-protected
-VOCAB
-	:	'\3'..'\377'
-	;
-
-
-// an identifier.  Note that testLiterals is set to true!  This means
-// that after we match the rule, we look in the literals table to see
-// if it's a literal or really an identifer
-IDENT
-	options {testLiterals=true;}
-        :
-    ( '\u0024' | '\u0041'..'\u005a' | '\u005f' | '\u0061'..'\u007a' |
-      '\u00c0'..'\u00d6' | '\u00d8'..'\u00f6' | '\u00f8'..'\u00ff' )
-      
-    ( '\u0024' | '\u0041'..'\u005a' | '\u005f' | '\u0061'..'\u007a' |
-      '\u00c0'..'\u00d6' | '\u00d8'..'\u00f6' | '\u00f8'..'\u00ff' | 
-      
-      '\u0030'..'\u0039' )*
-//	:	('a'..'z'|'A'..'Z'|'_'|'$') ('a'..'z'|'A'..'Z'|'_'|'0'..'9'|'$')*
-	;
-
-
-// a numeric literal
-NUM_INT
-	{boolean isDecimal=false;}
-	:	'.' {_ttype = DOT;}
-			(('0'..'9')+ (EXPONENT)? (FLOAT_SUFFIX)? { _ttype = NUM_FLOAT; })?
-	|	(	'0' {isDecimal = true;} // special case for just '0'
-			(	('x'|'X')
-				(											// hex
-					// the 'e'|'E' and float suffix stuff look
-					// like hex digits, hence the (...)+ doesn't
-					// know when to stop: ambig.  ANTLR resolves
-					// it correctly by matching immediately.  It
-					// is therefor ok to hush warning.
-					options {
-						warnWhenFollowAmbig=false;
-					}
-				:	HEX_DIGIT
-				)+
-			|	('0'..'7')+									// octal
-			)?
-		|	('1'..'9') ('0'..'9')*  {isDecimal=true;}		// non-zero decimal
-		)
-		(	('l'|'L')
-		
-		// only check to see if it's a float if looks like decimal so far
-		|	{isDecimal}?
-			(	'.' ('0'..'9')* (EXPONENT)? (FLOAT_SUFFIX)?
-			|	EXPONENT (FLOAT_SUFFIX)?
-			|	FLOAT_SUFFIX
-			)
-			{ _ttype = NUM_FLOAT; }
-		)?
-	;
-
-
-// a couple protected methods to assist in matching floating point numbers
-protected
-EXPONENT
-	:	('e'|'E') ('+'|'-')? ('0'..'9')+
-	;
-
-
-protected
-FLOAT_SUFFIX
-	:	'f'|'F'|'d'|'D'
-	;
-

+ 0 - 96
jplag.frontend.java-1.2/src/main/java/de/jplag/java/JavaToken.java

@@ -1,96 +0,0 @@
-package de.jplag.java;
-
-import de.jplag.Token;
-
-public class JavaToken extends Token implements JavaTokenConstants {
-	private static final long serialVersionUID = 1581274829013336295L;
-	private int line, column, length;
-
-	public JavaToken(int type, String file, int line, int column, int length) {
-		super(type, file, line, column, length);
-	}
-
-	@Override
-    public int getLine() {
-		return line;
-	}
-
-	@Override
-    public int getColumn() {
-		return column;
-	}
-
-	@Override
-    public int getLength() {
-		return length;
-	}
-
-	@Override
-    public void setLine(int line) {
-		this.line = line;
-	}
-
-	@Override
-    public void setColumn(int column) {
-		this.column = column;
-	}
-
-	@Override
-    public void setLength(int length) {
-		this.length = length;
-	}
-
-  public static String type2string(int type) {
-    switch (type) {
-    case JavaTokenConstants.FILE_END:
-                            return "********";
-    case J_PACKAGE:         return "PACKAGE ";
-    case J_IMPORT:          return "IMPORT  ";
-    case J_CLASS_BEGIN:     return "CLASS{  ";
-    case J_CLASS_END:       return "}CLASS  ";
-    case J_METHOD_BEGIN:    return "METHOD{ ";
-    case J_METHOD_END:      return "}METHOD ";
-    case J_VARDEF:          return "VARDEF  ";
-    case J_SYNC_BEGIN:      return "SYNC{   ";
-    case J_SYNC_END:        return "}SYNC   ";
-    case J_DO_BEGIN:        return "DO{     ";
-    case J_DO_END:          return "}DO     ";
-    case J_WHILE_BEGIN:     return "WHILE{  ";
-    case J_WHILE_END:       return "}WHILE  ";
-    case J_FOR_BEGIN:       return "FOR{    ";
-    case J_FOR_END:         return "}FOR    ";
-    case J_SWITCH_BEGIN:    return "SWITCH{ ";
-    case J_SWITCH_END:      return "}SWITCH ";
-    case J_CASE:            return "CASE    ";
-    case J_TRY_BEGIN:       return "TRY{    ";
-    case J_CATCH_BEGIN:     return "CATCH{  ";
-    case J_CATCH_END:       return "}CATCH  ";
-    case J_FINALLY:         return "FINALLY ";
-    case J_IF_BEGIN:        return "IF{     ";
-    case J_ELSE:            return "ELSE    ";
-    case J_IF_END:          return "}IF     ";
-    case J_COND:            return "COND    ";
-    case J_BREAK:           return "BREAK   ";
-    case J_CONTINUE:        return "CONTINUE";
-    case J_RETURN:          return "RETURN  ";
-    case J_THROW:           return "THROW   ";
-    case J_IN_CLASS_BEGIN:  return "INCLASS{";
-    case J_IN_CLASS_END:    return "}INCLASS";
-    case J_APPLY:           return "APPLY   ";
-    case J_NEWCLASS:        return "NEWCLASS";
-    case J_NEWARRAY:        return "NEWARRAY";
-    case J_ASSIGN:          return "ASSIGN  ";
-    case J_INTERFACE_BEGIN: return "INTERF{ ";
-    case J_INTERFACE_END:   return "}INTERF ";
-    case J_CONSTR_BEGIN:    return "CONSTR{ ";
-    case J_CONSTR_END:      return "}CONSTR ";
-    case J_INIT_BEGIN:      return "INIT{   ";
-    case J_INIT_END:        return "}INIT   ";
-    case J_VOID:            return "VOID    ";
-    case J_ARRAY_INIT_BEGIN:return "ARRINIT{";
-    case J_ARRAY_INIT_END:  return "ARRINIT}";
-
-    default:           return "<UNBEKANNT>";
-    }
-  }
-}

+ 0 - 55
jplag.frontend.java-1.2/src/main/java/de/jplag/java/JavaTokenConstants.java

@@ -1,55 +0,0 @@
-package de.jplag.java;
-
-import de.jplag.TokenConstants;
-
-public interface JavaTokenConstants extends TokenConstants {
-  final static int FILE_END = 0;
-
-  final static int J_PACKAGE = 1;               //
-  final static int J_IMPORT = 2;                //
-  final static int J_CLASS_BEGIN = 3;           //
-  final static int J_CLASS_END = 4;             //
-  final static int J_METHOD_BEGIN = 5;          //
-  final static int J_METHOD_END = 6;            //
-  final static int J_VARDEF = 7;                //
-  final static int J_SYNC_BEGIN = 8;            //
-  final static int J_SYNC_END = 9;              //
-  final static int J_DO_BEGIN = 10;             //
-  final static int J_DO_END = 11;               //
-  final static int J_WHILE_BEGIN = 12;          //
-  final static int J_WHILE_END = 13;            //
-  final static int J_FOR_BEGIN = 14;            //
-  final static int J_FOR_END = 15;              //
-  final static int J_SWITCH_BEGIN = 16;         //
-  final static int J_SWITCH_END = 17;           //
-  final static int J_CASE = 18;                 //
-  final static int J_TRY_BEGIN = 19;            //
-  final static int J_CATCH_BEGIN = 20;          //
-  final static int J_CATCH_END = 21;            //
-  final static int J_FINALLY = 22;              //
-  final static int J_IF_BEGIN = 23;             //
-  final static int J_ELSE = 24;                 //
-  final static int J_IF_END = 25;               //
-  final static int J_COND = 26;                 //
-  final static int J_BREAK = 27;                //
-  final static int J_CONTINUE = 28;             //
-  final static int J_RETURN = 29;               //
-  final static int J_THROW = 30;                //
-  final static int J_IN_CLASS_BEGIN=31;         //
-  final static int J_IN_CLASS_END = 32;         //
-  final static int J_APPLY = 33;                //
-  final static int J_NEWCLASS = 34;             //
-  final static int J_NEWARRAY = 35;             //
-  final static int J_ASSIGN = 36;               //
-  final static int J_INTERFACE_BEGIN=37;        //
-  final static int J_INTERFACE_END = 38;        //
-  final static int J_CONSTR_BEGIN = 39;         //
-  final static int J_CONSTR_END = 40;           //
-  final static int J_INIT_BEGIN = 41;           //
-  final static int J_INIT_END = 42;             //
-  final static int J_VOID = 43;                 //
-  final static int J_ARRAY_INIT_BEGIN = 44;     //
-  final static int J_ARRAY_INIT_END = 45;       //
-
-  final static int NUM_DIFF_TOKENS = 46;
-}

+ 0 - 76
jplag.frontend.java-1.2/src/main/java/de/jplag/java/Language.java

@@ -1,76 +0,0 @@
-package de.jplag.java;
-
-import java.io.File;
-
-import de.jplag.ErrorConsumer;
-import de.jplag.TokenList;
-
-public class Language implements de.jplag.Language {
-	private Parser parser;
-
-	public Language(ErrorConsumer program) {
-		this.parser = new Parser();
-		this.parser.setProgram(program);
-	}
-
-	@Override
-    public String[] suffixes() {
-		String[] res = { ".java", ".jav", ".JAVA", ".JAV" };
-		return res;
-	}
-
-	@Override
-    public int errorCount() {
-		return this.parser.errorsCount();
-	}
-
-	@Override
-    public String getName() {
-		return "Java1.2 AbstractParser";
-	}
-
-	@Override
-    public String getShortName() {
-		return "java12";
-	}
-
-	@Override
-    public int minimumTokenMatch() {
-		return 9;
-	}
-
-	@Override
-    public TokenList parse(File dir, String[] files) {
-		return this.parser.parse(dir, files);
-	}
-
-	@Override
-    public boolean hasErrors() {
-		return this.parser.hasErrors();
-	}
-
-	@Override
-    public boolean supportsColumns() {
-		return true;
-	}
-
-	@Override
-    public boolean isPreformatted() {
-		return true;
-	}
-
-	@Override
-    public boolean usesIndex() {
-		return false;
-	}
-
-	@Override
-    public int numberOfTokens() {
-		return JavaTokenConstants.NUM_DIFF_TOKENS;
-	}
-
-	@Override
-    public String type2string(int type) {
-		return JavaToken.type2string(type);
-	}
-}

+ 0 - 68
jplag.frontend.java-1.2/src/main/java/de/jplag/java/Parser.java

@@ -1,68 +0,0 @@
-package de.jplag.java;
-
-import java.io.File;
-import java.io.FileInputStream;
-
-import antlr.Token;
-import de.jplag.AbstractParser;
-import de.jplag.InputState;
-import de.jplag.ParserToken;
-import de.jplag.TokenList;
-import de.jplag.java.grammar.JLexer;
-import de.jplag.java.grammar.JRecognizer;
-
-public class Parser extends AbstractParser implements JavaTokenConstants {
-	private TokenList struct;
-	private String currentFile;
-
-	public TokenList parse(File dir, String files[]) {
-		struct = new TokenList();
-		errors = 0;
-		for (int i = 0; i < files.length; i++) {
-			getErrorConsumer().print(null, "Parsing file " + files[i]);
-			if (!parseFile(dir, files[i]))
-				errors++;
-			System.gc();//Emeric
-			struct.addToken(new JavaToken(FILE_END, files[i], -1, -1, -1));
-		}
-		this.parseEnd();
-		return struct;
-	}
-
-	private boolean parseFile(File dir, String file) {
-		InputState inputState = null;
-		try {
-			FileInputStream fis = new FileInputStream(new File(dir, file));
-			currentFile = file;
-			// Create a scanner that reads from the input stream passed to us
-			inputState = new InputState(fis);
-			JLexer lexer = new JLexer(inputState);
-			lexer.setFilename(file);
-			lexer.setTokenObjectClass("de.jplag.ParserToken");
-
-			// Create a parser that reads from the scanner
-			JRecognizer parser = new JRecognizer(lexer);
-			parser.setFilename(file);
-			parser.parser = this;
-
-			// start parsing at the compilationUnit rule
-			parser.compilationUnit();
-
-			// close file
-			fis.close();
-		} catch (Exception e) {
-			getErrorConsumer().addError(
-					"  Parsing Error in '" + file + "':\n" + "  Parse error at line "
-							+ (inputState != null ? "" + inputState.getLine() : "UNKNOWN") + ", column "
-							+ (inputState != null ? "" + inputState.tokColumn : "UNKNOWN") + ": " + e.getMessage());
-			return false;
-		}
-
-		return true;
-	}
-
-	public void add(int type, Token tok) {
-		ParserToken ptok = (ParserToken) tok;
-		struct.addToken(new JavaToken(type, currentFile, ptok.getLine(), ptok.getColumn(), ptok.getLength()));
-	}
-}

+ 0 - 6
jplag.frontend.java-1.5/.gitignore

@@ -1,6 +0,0 @@
-src/main/java/de/jplag/java15/grammar/CharStream.java
-src/main/java/de/jplag/java15/grammar/JavaParser.java
-src/main/java/de/jplag/java15/grammar/JavaParserConstants.java
-src/main/java/de/jplag/java15/grammar/JavaParserTokenManager.java
-src/main/java/de/jplag/java15/grammar/ParseException.java
-src/main/java/de/jplag/java15/grammar/TokenMgrError.java

+ 0 - 77
jplag.frontend.java-1.5/pom.xml

@@ -1,77 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <version>0.0.1-SNAPSHOT</version>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>build-helper-maven-plugin</artifactId>
-        <version>3.2.0</version>
-        <configuration>
-          <sources>
-            <source>target/generated-sources/javacc</source>
-          </sources>
-        </configuration>
-        <executions>
-          <execution>
-            <id>add-javacc-source</id>
-            <phase>generate-sources</phase>
-            <goals>
-              <goal>add-source</goal>
-            </goals>
-
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>javacc-maven-plugin</artifactId>
-        <version>2.0</version>
-        <configuration>
-          <grammarEncoding>${project.build.sourceEncoding}</grammarEncoding>
-          <debugparser>false</debugparser>
-          <isStatic>false</isStatic>
-          <outputDirectory>${project.basedir}/src/main/java/de/jplag/java15/grammar</outputDirectory>
-        </configuration>
-        <executions>
-          <execution>
-            <id>javacc</id>
-            <goals>
-              <goal>javacc</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-jar-plugin</artifactId>
-        <configuration>
-          <archive>
-            <manifest>
-              <mainClass>de.jplag.java15.Parser</mainClass>
-              <packageName>jplag.java15</packageName>
-            </manifest>
-          </archive>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-
-  <dependencies>
-    <dependency>
-      <groupId>de.jplag</groupId>
-      <artifactId>frontend-utils</artifactId>
-    </dependency>
-  </dependencies>
-  <parent>
-    <groupId>de.jplag</groupId>
-    <artifactId>parent</artifactId>
-    <version>0.3-SNAPSHOT</version>
-    <relativePath>../jplag.parent/pom.xml</relativePath>
-  </parent>
-  <artifactId>java-1.5</artifactId>
-</project>

+ 0 - 95
jplag.frontend.java-1.5/src/main/java/de/jplag/java15/JavaToken.java

@@ -1,95 +0,0 @@
-package de.jplag.java15;
-
-import de.jplag.Token;
-
-public class JavaToken extends Token implements JavaTokenConstants {
-	private static final long serialVersionUID = 3743208940428676175L;
-	private int line, column, length;
-
-	public JavaToken(int type, String file, int line, int column, int length) {
-		super(type, file, line, column, length);
-	}
-
-	@Override
-    public int getLine() { return line; }
-	@Override
-    public int getColumn() { return column; }
-	@Override
-    public int getLength() { return length; }
-	@Override
-    public void setLine(int line) { this.line = line; }
-	@Override
-    public void setColumn(int column) { this.column = column; }
-	@Override
-    public void setLength(int length) { this.length = length; }
-
-  public static String type2string(int type) {
-    switch (type) {
-		case JavaTokenConstants.FILE_END:				// @formatter:off
-                            return "********";
-	case JavaTokenConstants.SEPARATOR_TOKEN:
-							return "METHOD_SEPARATOR";
-    case J_PACKAGE:         return "PACKAGE ";
-    case J_IMPORT:          return "IMPORT  ";
-    case J_CLASS_BEGIN:     return "CLASS{  ";
-    case J_CLASS_END:       return "}CLASS  ";
-    case J_METHOD_BEGIN:    return "METHOD{ ";
-    case J_METHOD_END:      return "}METHOD ";
-    case J_VARDEF:          return "VARDEF  ";
-    case J_SYNC_BEGIN:      return "SYNC{   ";
-    case J_SYNC_END:        return "}SYNC   ";
-    case J_DO_BEGIN:        return "DO{     ";
-    case J_DO_END:          return "}DO     ";
-    case J_WHILE_BEGIN:     return "WHILE{  ";
-    case J_WHILE_END:       return "}WHILE  ";
-    case J_FOR_BEGIN:       return "FOR{    ";
-    case J_FOR_END:         return "}FOR    ";
-    case J_SWITCH_BEGIN:    return "SWITCH{ ";
-    case J_SWITCH_END:      return "}SWITCH ";
-    case J_CASE:            return "CASE    ";
-    case J_TRY_BEGIN:       return "TRY{    ";
-    case J_CATCH_BEGIN:     return "CATCH{  ";
-    case J_CATCH_END:       return "}CATCH  ";
-    case J_FINALLY:         return "FINALLY ";
-    case J_IF_BEGIN:        return "IF{     ";
-    case J_ELSE:            return "ELSE    ";
-    case J_IF_END:          return "}IF     ";
-    case J_COND:            return "COND    ";
-    case J_BREAK:           return "BREAK   ";
-    case J_CONTINUE:        return "CONTINUE";
-    case J_RETURN:          return "RETURN  ";
-    case J_THROW:           return "THROW   ";
-    case J_IN_CLASS_BEGIN:  return "INCLASS{";
-    case J_IN_CLASS_END:    return "}INCLASS";
-    case J_APPLY:           return "APPLY   ";
-    case J_NEWCLASS:        return "NEWCLASS";
-    case J_NEWARRAY:        return "NEWARRAY";
-    case J_ASSIGN:          return "ASSIGN  ";
-    case J_INTERFACE_BEGIN: return "INTERF{ ";
-    case J_INTERFACE_END:   return "}INTERF ";
-    case J_CONSTR_BEGIN:    return "CONSTR{ ";
-    case J_CONSTR_END:      return "}CONSTR ";
-    case J_INIT_BEGIN:      return "INIT{   ";
-    case J_INIT_END:        return "}INIT   ";
-    case J_VOID:            return "VOID    ";
-    case J_ARRAY_INIT_BEGIN:return "ARRINIT{";
-    case J_ARRAY_INIT_END:  return "ARRINIT}";
-    case J_ENUM_BEGIN:      return "ENUM{   ";
-    case J_ENUM_CLASS_BEGIN:return "ENUM_CLA";
-    case J_ENUM_END:        return "}ENUM   ";
-    case J_GENERIC:         return "GENERIC ";
-    case J_ASSERT:          return "ASSERT  ";
-    case J_ANNO:            return "ANNO    ";
-    case J_ANNO_MARKER:     return "ANNOMARK";
-    case J_ANNO_M_BEGIN:    return "ANNO_M{ ";
-    case J_ANNO_M_END:      return "}ANNO_M ";
-    case J_ANNO_T_BEGIN:    return "ANNO_T{ ";
-    case J_ANNO_T_END:      return "}ANNO_T ";
-    case J_ANNO_C_BEGIN:    return "ANNO_C{ ";
-    case J_ANNO_C_END:      return "}ANNO_C ";
-
-    default:                return "*UNKNOWN"; // @formatter:on
-    }
-  }
-}
-

+ 0 - 74
jplag.frontend.java-1.5/src/main/java/de/jplag/java15/JavaTokenConstants.java

@@ -1,74 +0,0 @@
-package de.jplag.java15;
-
-import de.jplag.TokenConstants;
-
-public interface JavaTokenConstants extends TokenConstants {
-  final static int FILE_END = 0;
-  
-  // Used to optionally separate methods from each other
-  // with an always marked token
-  final static int SEPARATOR_TOKEN = 1;
-
-  final static int J_PACKAGE = 2;               //
-  final static int J_IMPORT = 3;                //
-  final static int J_CLASS_BEGIN = 4;           //
-  final static int J_CLASS_END = 5;             //
-  final static int J_METHOD_BEGIN = 6;          //
-  final static int J_METHOD_END = 7;            //
-  final static int J_VARDEF = 8;                //
-  final static int J_SYNC_BEGIN = 9;            //
-  final static int J_SYNC_END = 10;              //
-  final static int J_DO_BEGIN = 11;             //
-  final static int J_DO_END = 12;               //
-  final static int J_WHILE_BEGIN = 13;          //
-  final static int J_WHILE_END = 14;            //
-  final static int J_FOR_BEGIN = 15;            //
-  final static int J_FOR_END = 16;              //
-  final static int J_SWITCH_BEGIN = 17;         //
-  final static int J_SWITCH_END = 18;           //
-  final static int J_CASE = 19;                 //
-  final static int J_TRY_BEGIN = 20;            //
-  final static int J_CATCH_BEGIN = 21;          //
-  final static int J_CATCH_END = 22;            //
-  final static int J_FINALLY = 23;              //
-  final static int J_IF_BEGIN = 24;             //
-  final static int J_ELSE = 25;                 //
-  final static int J_IF_END = 26;               //
-  final static int J_COND = 27;                 //
-  final static int J_BREAK = 28;                //
-  final static int J_CONTINUE = 29;             //
-  final static int J_RETURN = 30;               //
-  final static int J_THROW = 31;                //
-  final static int J_IN_CLASS_BEGIN=32;         //
-  final static int J_IN_CLASS_END = 33;         //
-  final static int J_APPLY = 34;                //
-  final static int J_NEWCLASS = 35;             //
-  final static int J_NEWARRAY = 36;             //
-  final static int J_ASSIGN = 37;               //
-  final static int J_INTERFACE_BEGIN=38;        //
-  final static int J_INTERFACE_END = 39;        //
-  final static int J_CONSTR_BEGIN = 40;         //
-  final static int J_CONSTR_END = 41;           //
-  final static int J_INIT_BEGIN = 42;           //
-  final static int J_INIT_END = 43;             //
-  final static int J_VOID = 44;                 //
-  final static int J_ARRAY_INIT_BEGIN = 45;     //
-  final static int J_ARRAY_INIT_END = 46;       //
-  // new in 1.5:
-  final static int J_ENUM_BEGIN = 47;           //
-  final static int J_ENUM_CLASS_BEGIN = 48;     //
-  final static int J_ENUM_END = 49;             //
-  final static int J_GENERIC = 50;              //
-  final static int J_ASSERT = 51;               //
-
-  final static int J_ANNO = 52;                 //
-  final static int J_ANNO_MARKER = 53;          //
-  final static int J_ANNO_M_BEGIN = 54;         //
-  final static int J_ANNO_M_END = 55;           //
-  final static int J_ANNO_T_BEGIN = 56;         //
-  final static int J_ANNO_T_END = 57;           //
-  final static int J_ANNO_C_BEGIN = 58;         //
-  final static int J_ANNO_C_END = 59;           //
-  
-  final static int NUM_DIFF_TOKENS = 60;
-}

+ 0 - 76
jplag.frontend.java-1.5/src/main/java/de/jplag/java15/Language.java

@@ -1,76 +0,0 @@
-package de.jplag.java15;
-
-import java.io.File;
-
-import de.jplag.ErrorConsumer;
-import de.jplag.TokenList;
-
-public class Language implements de.jplag.Language {
-	private Parser parser;
-
-	public Language(ErrorConsumer program) {
-		this.parser = new Parser(false);
-		this.parser.setProgram(program);
-	}
-
-	@Override
-    public int errorCount() {
-		return this.parser.errorsCount();
-	}
-
-	@Override
-    public String[] suffixes() {
-		String[] res = { ".java", ".jav", ".JAVA", ".JAV" };
-		return res;
-	}
-
-	@Override
-    public String getName() {
-		return "Java1.5 AbstractParser";
-	}
-
-	@Override
-    public String getShortName() {
-		return "java15";
-	}
-
-	@Override
-    public int minimumTokenMatch() {
-		return 8;
-	}
-
-	@Override
-    public TokenList parse(File dir, String[] files) {
-		return this.parser.parse(dir, files);
-	}
-
-	@Override
-    public boolean hasErrors() {
-		return this.parser.hasErrors();
-	}
-
-	@Override
-    public boolean supportsColumns() {
-		return true;
-	}
-
-	@Override
-    public boolean isPreformatted() {
-		return true;
-	}
-
-	@Override
-    public boolean usesIndex() {
-		return false;
-	}
-
-	@Override
-    public int numberOfTokens() {
-		return JavaTokenConstants.NUM_DIFF_TOKENS;
-	}
-
-	@Override
-    public String type2string(int type) {
-		return JavaToken.type2string(type);
-	}
-}

+ 0 - 82
jplag.frontend.java-1.5/src/main/java/de/jplag/java15/LanguageWithDelimitedMethods.java

@@ -1,82 +0,0 @@
-package de.jplag.java15;
-
-import java.io.File;
-
-import de.jplag.Language;
-import de.jplag.ErrorConsumer;
-import de.jplag.TokenList;
-
-/**
- * Java 1.5 parser with method separators; if you know why these separators
- * exist, PLEASE tell us or document at
- * https://svn.ipd.kit.edu/trac/de/jplag/wiki/Server/Frontends/Java-1.5)
- */
-public class LanguageWithDelimitedMethods implements Language {
-	private Parser parser;
-
-	public LanguageWithDelimitedMethods(ErrorConsumer program) {
-		this.parser = new Parser(true);
-		this.parser.setProgram(program);
-	}
-
-	@Override
-    public int errorCount() {
-		return this.parser.errorsCount();
-	}
-
-	@Override
-    public String[] suffixes() {
-		String[] res = { ".java", ".jav", ".JAVA", ".JAV" };
-		return res;
-	}
-
-	@Override
-    public String getName() {
-		return "Java1.5 Parser with delimited methods";
-	}
-
-	@Override
-    public String getShortName() {
-		return "java15dm";
-	}
-
-	@Override
-    public int minimumTokenMatch() {
-		return 8;
-	}
-
-	@Override
-    public TokenList parse(File dir, String[] files) {
-		return this.parser.parse(dir, files);
-	}
-
-	@Override
-    public boolean hasErrors() {
-		return this.parser.hasErrors();
-	}
-
-	@Override
-    public boolean supportsColumns() {
-		return true;
-	}
-
-	@Override
-    public boolean isPreformatted() {
-		return true;
-	}
-
-	@Override
-    public boolean usesIndex() {
-		return false;
-	}
-
-	@Override
-    public int numberOfTokens() {
-		return JavaTokenConstants.NUM_DIFF_TOKENS;
-	}
-
-	@Override
-    public String type2string(int type) {
-		return JavaToken.type2string(type);
-	}
-}

+ 0 - 51
jplag.frontend.java-1.5/src/main/java/de/jplag/java15/Parser.java

@@ -1,51 +0,0 @@
-package de.jplag.java15;
-
-import java.io.File;
-
-import de.jplag.AbstractParser;
-import de.jplag.TokenList;
-import de.jplag.java15.grammar.JavaParser;
-import de.jplag.java15.grammar.Token;
-
-public class Parser extends AbstractParser implements JavaTokenConstants {
-	private String actFile;
-	private boolean useMethodSeparators;
-
-	private TokenList struct;
-
-	public Parser(boolean useMethodSeparators) {
-		this.useMethodSeparators = useMethodSeparators;
-	}
-
-	public TokenList parse(File dir, String files[]) {
-		struct = new TokenList();
-		errors = 0;
-
-		JavaParser parser = null; // This will be (re)initialised in parseFile()
-
-		for (int i = 0; i < files.length; i++) {
-			actFile = files[i];
-			getErrorConsumer().print(null, "Parsing file " + files[i]);
-			if (!JavaParser.parseFile(dir, files[i], parser, this))
-				errors++;
-
-			struct.addToken(new JavaToken(FILE_END, actFile, -1, -1, -1));
-		}
-
-		this.parseEnd();
-		return struct;
-	}
-
-	public void add(int type, Token token) {
-		if (type == SEPARATOR_TOKEN && !useMethodSeparators)
-			return;
-
-		JavaToken tok = new JavaToken(type, actFile, token.beginLine, token.beginColumn, token.image.length());
-		struct.addToken(tok);
-
-		/*
-		 * getErrorConsumer().print(null,token.beginLine+"\t"+
-		 * JavaToken.type2string(type)+"\t"+ token.image);
-		 */
-	}
-}

+ 0 - 496
jplag.frontend.java-1.5/src/main/java/de/jplag/java15/grammar/JavaTabModCharStream.java

@@ -1,496 +0,0 @@
-/* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 3.0 */
-package de.jplag.java15.grammar;
-
-/**
- * An implementation of interface CharStream, where the stream is assumed to
- * contain only ASCII characters (with java-like unicode escape processing).
- * 
- * Modification: Tabs are kept as single characters in column calculation
- */
-
-public class JavaTabModCharStream implements CharStream
-{
-  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
-  }
-
-  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 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];
-  }
-
-  @Override
-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;
-        default :
-           break;
-     }
-
-     bufline[bufpos] = line;
-     bufcolumn[bufpos] = column;
-  }
-
-  @Override
-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)
-           {
-              if (backSlashCnt > 1)
-                 backup(backSlashCnt);
-
-              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 
-   * @see #getEndColumn
-   */
-
-  @Deprecated
-@Override
-public int getColumn() {
-     return bufcolumn[bufpos];
-  }
-
-  /**
-   * @deprecated 
-   * @see #getEndLine
-   */
-
-  @Deprecated
-@Override
-public int getLine() {
-     return bufline[bufpos];
-  }
-
-  @Override
-public int getEndColumn() {
-     return bufcolumn[bufpos];
-  }
-
-  @Override
-public int getEndLine() {
-     return bufline[bufpos];
-  }
-
-  @Override
-public int getBeginColumn() {
-     return bufcolumn[tokenBegin];
-  }
-
-  @Override
-public int getBeginLine() {
-     return bufline[tokenBegin];
-  }
-
-  @Override
-public void backup(int amount) {
-
-    inBuf += amount;
-    if ((bufpos -= amount) < 0)
-       bufpos += bufsize;
-  }
-
-  public JavaTabModCharStream(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];
-  }
-
-  public JavaTabModCharStream(java.io.Reader dstream,
-                                        int startline, int startcolumn)
-  {
-     this(dstream, startline, startcolumn, 4096);
-  }
-
-  public JavaTabModCharStream(java.io.Reader dstream)
-  {
-     this(dstream, 1, 1, 4096);
-  }
-  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;
-  }
-
-  public void ReInit(java.io.Reader dstream)
-  {
-     ReInit(dstream, 1, 1, 4096);
-  }
-  public JavaTabModCharStream(java.io.InputStream dstream, int startline,
-		  int startcolumn, int buffersize)
-  {
-     this(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
-  }
-
-  public JavaTabModCharStream(java.io.InputStream dstream, int startline,
-                                                           int startcolumn)
-  {
-     this(dstream, startline, startcolumn, 4096);
-  }
-
-  public JavaTabModCharStream(java.io.InputStream dstream)
-  {
-     this(dstream, 1, 1, 4096);
-  }
-
-  public void ReInit(java.io.InputStream dstream, int startline,
-		  int startcolumn, int buffersize)
-  {
-     ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
-  }
-
-  @Override
-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);
-  }
-
-  @Override
-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;
-  }
-
-  @Override
-public void Done()
-  {
-     nextCharBuf = null;
-     buffer = null;
-     bufline = null;
-     bufcolumn = null;
-  }
-
-}

+ 0 - 91
jplag.frontend.java-1.5/src/main/java/de/jplag/java15/grammar/Token.java

@@ -1,91 +0,0 @@
-/* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
-package de.jplag.java15.grammar;
-
-/**
- * Describes the input token stream.
- */
-
-public class Token {
-
-  /**
-   * 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;
-
-  /**
-   * beginLine and beginColumn describe the position of the first character
-   * of this token; endLine and endColumn describe the position of the
-   * last character of this token.
-   */
-  public int beginLine, beginColumn, endLine, 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;
-
-  /**
-   * 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, simlpy add something like :
-   *
-   *    case MyParserConstants.ID : return new IDToken();
-   *
-   * to the following switch statement. Then you can cast matchedToken
-   * variable to the appropriate type and use it in your lexical actions.
-   */
-  public static final Token newToken(int ofKind)
-  {
-     switch(ofKind)
-     {
-		case JavaParserConstants.RUNSIGNEDSHIFT:
-		case JavaParserConstants.RSIGNEDSHIFT:
-		case JavaParserConstants.GT:
-			return new GTToken();
-
-		default:
-			return new Token();
-     }
-  }
-
-	public static class GTToken extends Token {
-		int realKind = JavaParserConstants.GT;
-	}
-}

+ 0 - 1557
jplag.frontend.java-1.5/src/main/javacc/Java1.5.jj

@@ -1,1557 +0,0 @@
-/* Hey Emacs, this is -*- mode: java; page-delimiter: "^%%$"; -*- */
-
-/*
- * Copyright © 2002 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * California 95054, U.S.A. All rights reserved.  Sun Microsystems, Inc. has
- * intellectual property rights relating to technology embodied in the product
- * that is described in this document. In particular, and without limitation,
- * these intellectual property rights may include one or more of the U.S.
- * patents listed at http://www.sun.com/patents and one or more additional
- * patents or pending patent applications in the U.S. and in other countries.
- * U.S. Government Rights - Commercial software. Government users are subject
- * to the Sun Microsystems, Inc. standard license agreement and applicable
- * provisions of the FAR and its supplements.  Use is subject to license terms.
- * Sun,  Sun Microsystems,  the Sun logo and  Java are trademarks or registered
- * trademarks of Sun Microsystems, Inc. in the U.S. and other countries.  This
- * product is covered and controlled by U.S. Export Control laws and may be
- * subject to the export or import laws in other countries.  Nuclear, missile,
- * chemical biological weapons or nuclear maritime end uses or end users,
- * whether direct or indirect, are strictly prohibited.  Export or reexport
- * to countries subject to U.S. embargo or to entities identified on U.S.
- * export exclusion lists, including, but not limited to, the denied persons
- * and specially designated nationals lists is strictly prohibited.
- */
-
-options {
-  JAVA_UNICODE_ESCAPE = true;
-  ERROR_REPORTING = false;
-  STATIC = false;
-  USER_CHAR_STREAM = true;
-}
-
-PARSER_BEGIN(JavaParser)
-package de.jplag.java15.grammar;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.nio.charset.StandardCharsets;
-
-import de.jplag.UnicodeReader;
-import de.jplag.java15.JavaTokenConstants;
-
-/**
- * Grammar to parse Java version 1.5
- * @author Sreenivasa Viswanadha - Simplified and enhanced for 1.5
- */
-public class JavaParser implements JavaTokenConstants
-{
-    /**
-     * Class to hold modifiers.
-     */
-  
-    private de.jplag.java15.Parser parser2;
-    static public final class ModifierSet
-    {
-        /* Definitions of the bits in the modifiers field.  */
-        public static final int PUBLIC = 0x0001;
-        public static final int PROTECTED = 0x0002;
-        public static final int PRIVATE = 0x0004;
-        public static final int ABSTRACT = 0x0008;
-        public static final int STATIC = 0x0010;
-        public static final int FINAL = 0x0020;
-        public static final int SYNCHRONIZED = 0x0040;
-        public static final int NATIVE = 0x0080;
-        public static final int TRANSIENT = 0x0100;
-        public static final int VOLATILE = 0x0200;
-        public static final int STRICTFP = 0x1000;
-
-        /** A set of accessors that indicate whether the specified modifier is in the set. */
-
-        public boolean isPublic(int modifiers)
-        {
-            return (modifiers & PUBLIC) != 0;
-        }
-
-        public boolean isProtected(int modifiers)
-        {
-            return (modifiers & PROTECTED) != 0;
-        }
-
-        public boolean isPrivate(int modifiers)
-        {
-            return (modifiers & PRIVATE) != 0;
-        }
-
-        public boolean isStatic(int modifiers)
-        {
-            return (modifiers & STATIC) != 0;
-        }
-
-        public boolean isAbstract(int modifiers)
-        {
-            return (modifiers & ABSTRACT) != 0;
-        }
-
-        public boolean isFinal(int modifiers)
-        {
-            return (modifiers & FINAL) != 0;
-        }
-
-        public boolean isNative(int modifiers)
-        {
-            return (modifiers & NATIVE) != 0;
-        }
-
-        public boolean isStrictfp(int modifiers)
-        {
-            return (modifiers & STRICTFP) != 0;
-        }
-
-        public boolean isSynchronized(int modifiers)
-        {
-            return (modifiers & SYNCHRONIZED) != 0;
-        }
-
-        public boolean isTransient(int modifiers)
-        {
-            return (modifiers & TRANSIENT) != 0;
-        }
-
-        public boolean isVolatile(int modifiers)
-        {
-            return (modifiers & VOLATILE) != 0;
-        }
-
-        /**
-          * Removes the given modifier.
-          */
-        static int removeModifier(int modifiers, int mod) {
-            return modifiers & ~mod;
-        }
-    }
-
-    //JavaParser parser = null;
-    JavaTabModCharStream charStream = null;
-
-    public static boolean parseFile(File dir, String fileName, JavaParser parser, de.jplag.java15.Parser parserX)
-    {
-        try {
-            FileInputStream in = new FileInputStream(new File(dir,fileName));
-            if (parser == null) {
-                JavaTabModCharStream charStream = new JavaTabModCharStream(new UnicodeReader(in, StandardCharsets.UTF_8));
-                parser = new JavaParser(charStream);
-                parser.charStream = charStream;
-            } else {
-                parser.charStream.ReInit(new UnicodeReader(in, StandardCharsets.UTF_8));
-                parser.ReInit(parser.charStream);
-            }
-            parser.parser2 = parserX;
-        } catch (FileNotFoundException e) {
-            System.out.println("Java Parser: File " + fileName + " not found.");
-            return false;
-        }
-        try {
-            parser.CompilationUnit();
-        } catch (ParseException e) {
-            parserX.getErrorConsumer().addError("  Parsing Error in '" + fileName + "':\n  " + e.getMessage() + "\n");
-            return false;
-        } catch (TokenMgrError e) {
-            parserX.getErrorConsumer().addError("  Scanning Error in '" + fileName + "':\n  " + e.getMessage() + "\n");
-            return false;
-        } catch (Exception e) {
-            parserX.getErrorConsumer().addError("  General error in '" + fileName + "':\n  " + e.getMessage() + "\n");
-            e.printStackTrace();
-            return false;
-        }
-        return true;
-    }
-}
-
-PARSER_END(JavaParser)
-
-/* WHITE SPACE */
-
-SKIP :
-{
-  " "
-| "\t"
-| "\n"
-| "\r"
-| "\f"
-}
-
-/* COMMENTS */
-
-SPECIAL_TOKEN :
-{
-  <SINGLE_LINE_COMMENT: "//" (~["\n", "\r"])* ("\n" | "\r" | "\r\n")? >
-}
-
-MORE :
-{
-  <"/**" ~["/"]> { input_stream.backup(1); } : IN_FORMAL_COMMENT
-|
-  "/*" : IN_MULTI_LINE_COMMENT
-}
-
-<IN_FORMAL_COMMENT>
-SPECIAL_TOKEN :
-{
-  <FORMAL_COMMENT: "*/" > : DEFAULT
-}
-
-<IN_MULTI_LINE_COMMENT>
-SPECIAL_TOKEN :
-{
-  <MULTI_LINE_COMMENT: "*/" > : DEFAULT
-}
-
-<IN_FORMAL_COMMENT,IN_MULTI_LINE_COMMENT>
-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 :
-{
-  < INTEGER_LITERAL:
-        <DECIMAL_LITERAL> (["l","L"])?
-      | <HEX_LITERAL> (["l","L"])?
-      | <OCTAL_LITERAL> (["l","L"])?
-  >
-|
-  < #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:
-        (["0"-"9"])+ "." (["0"-"9"])* (<EXPONENT>)? (["f","F","d","D"])?
-      | "." (["0"-"9"])+ (<EXPONENT>)? (["f","F","d","D"])?
-      | (["0"-"9"])+ <EXPONENT> (["f","F","d","D"])?
-      | (["0"-"9"])+ (<EXPONENT>)? ["f","F","d","D"]
-  >
-|
-  < #EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+ >
-|
-  < CHARACTER_LITERAL:
-      "'"
-      (   (~["'","\\","\n","\r"])
-        | ("\\"
-            ( ["n","t","b","r","f","\\","'","\""]
-            | ["0"-"7"] ( ["0"-"7"] )?
-            | ["0"-"3"] ["0"-"7"] ["0"-"7"]
-            )
-          )
-      )
-      "'"
-  >
-|
-  < STRING_LITERAL:
-      "\""
-      (   (~["\"","\\","\n","\r"])
-        | ("\\"
-            ( ["n","t","b","r","f","\\","'","\""]
-            | ["0"-"7"] ( ["0"-"7"] )?
-            | ["0"-"3"] ["0"-"7"] ["0"-"7"]
-            )
-          )
-      )*
-      "\""
-  >
-}
-
-/* IDENTIFIERS */
-
-TOKEN :
-{
-  < IDENTIFIER: <LETTER> (<LETTER>|<DIGIT>)* >
-|
-  < #LETTER:
-      [
-       "\u0024",
-       "\u0041"-"\u005a",
-       "\u005f",
-       "\u0061"-"\u007a",
-       "\u00c0"-"\u00d6",
-       "\u00d8"-"\u00f6",
-       "\u00f8"-"\u00ff",
-       "\u0100"-"\u1fff",
-       "\u3040"-"\u318f",
-       "\u3300"-"\u337f",
-       "\u3400"-"\u3d2d",
-       "\u4e00"-"\u9fff",
-       "\uf900"-"\ufaff"
-      ]
-  >
-|
-  < #DIGIT:
-      [
-       "\u0030"-"\u0039",
-       "\u0660"-"\u0669",
-       "\u06f0"-"\u06f9",
-       "\u0966"-"\u096f",
-       "\u09e6"-"\u09ef",
-       "\u0a66"-"\u0a6f",
-       "\u0ae6"-"\u0aef",
-       "\u0b66"-"\u0b6f",
-       "\u0be7"-"\u0bef",
-       "\u0c66"-"\u0c6f",
-       "\u0ce6"-"\u0cef",
-       "\u0d66"-"\u0d6f",
-       "\u0e50"-"\u0e59",
-       "\u0ed0"-"\u0ed9",
-       "\u1040"-"\u1049"
-      ]
-  >
-}
-
-/* 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;
-     ((Token.GTToken)matchedToken).realKind = RUNSIGNEDSHIFT;
-     input_stream.backup(2);
-  }
-| < RSIGNEDSHIFT: ">>" >
-  {
-     matchedToken.kind = GT;
-     ((Token.GTToken)matchedToken).realKind = RSIGNEDSHIFT;
-     input_stream.backup(1);
-  }
-| < GT: ">" >
-}
-
-
-/*****************************************
- * THE JAVA LANGUAGE GRAMMAR STARTS HERE *
- *****************************************/
-
-/*
- * Program structuring syntax follows.
- */
-
-void CompilationUnit():
-{}
-{
-  [ PackageDeclaration() ]
-  ( ImportDeclaration() )*
-  ( TypeDeclaration() )*
-  <EOF>
-}
-
-void PackageDeclaration():
-{}
-{
-  "package" { parser2.add(J_PACKAGE, token); }
-  Name() ";"
-    
-}
-
-void ImportDeclaration():
-{}
-{
-  "import" { parser2.add(J_IMPORT, token); }
-  [ "static" ] Name() [ "." "*" ] ";"
-}
-
-/*
- * 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.
- */
-
-int Modifiers():
-{
-   int modifiers = 0;
-}
-{
- (
-  LOOKAHEAD(2)
-  (
-   "public" { modifiers |= ModifierSet.PUBLIC; }
-  |
-   "static" { modifiers |= ModifierSet.STATIC; }
-  |
-   "protected" { modifiers |= ModifierSet.PROTECTED; }
-  |
-   "private" { modifiers |= ModifierSet.PRIVATE; }
-  |
-   "final" { modifiers |= ModifierSet.FINAL; }
-  |
-   "abstract" { modifiers |= ModifierSet.ABSTRACT; }
-  |
-   "synchronized" { modifiers |= ModifierSet.SYNCHRONIZED; }
-  |
-   "native" { modifiers |= ModifierSet.NATIVE; }
-  |
-   "transient" { modifiers |= ModifierSet.TRANSIENT; }
-  |
-   "volatile" { modifiers |= ModifierSet.VOLATILE; }
-  |
-   "strictfp" { modifiers |= ModifierSet.STRICTFP; }
-  |
-   Annotation()
-  )
- )*
-
- {
-    return modifiers;
- }
-}
-
-/*
- * Declaration syntax follows.
- */
-void TypeDeclaration():
-{
-   int modifiers;
-}
-{
-  ";"
-|
-  modifiers = Modifiers()
-  (
-     ClassOrInterfaceDeclaration(modifiers)
-   |
-     EnumDeclaration(modifiers)
-   |
-     AnnotationTypeDeclaration(modifiers)
-  )
-}
-
-
-void ClassOrInterfaceDeclaration(int modifiers):
-{
-   boolean isInterface = false;
-}
-{
-  ( "class" | "interface" { isInterface = true; } )
-        { parser2.add((isInterface ? J_INTERFACE_BEGIN : J_CLASS_BEGIN), token); }
-  <IDENTIFIER>
-  [ TypeParameters() ]
-  [ ExtendsList(isInterface) ]
-  [ ImplementsList(isInterface) ]
-  ClassOrInterfaceBody(isInterface)
-      { parser2.add((isInterface ? J_INTERFACE_END : J_CLASS_END), token); }
-}
-
-void ExtendsList(boolean isInterface):
-{
-   boolean extendsMoreThanOne = false;
-}
-{
-   "extends" ClassOrInterfaceType()
-   ( "," ClassOrInterfaceType() { extendsMoreThanOne = true; } )*
-   {
-      if (extendsMoreThanOne && !isInterface)
-         throw new ParseException("A class cannot extend more than one other class");
-   }
-}
-
-void ImplementsList(boolean isInterface):
-{}
-{
-   "implements" ClassOrInterfaceType()
-   ( "," ClassOrInterfaceType() )*
-   {
-      if (isInterface)
-         throw new ParseException("An interface cannot implement other interfaces");
-   }
-}
-
-void EnumDeclaration(int modifiers):
-{}
-{
-  "enum"							  { parser2.add(J_ENUM_BEGIN, token); }
-  <IDENTIFIER>
-  [ ImplementsList(false) ]
-  EnumBody()                          { parser2.add(J_ENUM_END, token); }
-}
-
-void EnumBody():
-{}
-{
-   "{"
-   EnumConstant() ( "," EnumConstant() )*
-   [ ";"                             { parser2.add(J_ENUM_CLASS_BEGIN, token); }
-     ( ClassOrInterfaceBodyDeclaration(false) )* ]
-   "}"
-}
-
-void EnumConstant():
-{}
-{
-  <IDENTIFIER> [ Arguments() ] [ ClassOrInterfaceBody(false) ]
-}
-
-void TypeParameters():
-{}
-{
-   "<" TypeParameter() ( "," TypeParameter() )* ">"
-}
-
-void TypeParameter():
-{}
-{
-   <IDENTIFIER> [ TypeBound() ]
-}
-
-void TypeBound():
-{}
-{
-   "extends" ClassOrInterfaceType() ( "&" ClassOrInterfaceType() )*
-}
-
-void ClassOrInterfaceBody(boolean isInterface):
-{}
-{
-  "{" ( ClassOrInterfaceBodyDeclaration(isInterface) )* "}"
-}
-
-void ClassOrInterfaceBodyDeclaration(boolean isInterface):
-{
-   boolean isNestedInterface = false;
-   int modifiers;
-}
-{
-  LOOKAHEAD(2)
-  Initializer()
-  {
-     if (isInterface)
-        throw new ParseException("An interface cannot have initializers");
-  }
-|
-  modifiers = Modifiers() // Just get all the modifiers out of the way. If you want to do
-              // more checks, pass the modifiers down to the member
-  (
-      ClassOrInterfaceDeclaration(modifiers)
-    |
-      EnumDeclaration(modifiers)
-    |
-      LOOKAHEAD( [ TypeParameters() ] <IDENTIFIER> "(" )
-      ConstructorDeclaration()
-    |
-      LOOKAHEAD( Type() <IDENTIFIER> ( "[" "]" )* ( "," | "=" | ";" ) )
-      FieldDeclaration(modifiers)
-    |
-      MethodDeclaration(modifiers)
-  )
-|
-  ";"
-}
-
-void FieldDeclaration(int modifiers):
-{}
-{
-  // Modifiers are already matched in the caller
-  Type() VariableDeclarator() ( "," VariableDeclarator() )* ";"
-}
-
-void VariableDeclarator():
-{}
-{
-  <IDENTIFIER>                  		  { parser2.add(J_VARDEF, token); }
-  ( "[" "]" )*
-  [ "="                                   { parser2.add(J_ASSIGN, token); }
-  VariableInitializer() ]
-}
-
-void VariableDeclaratorId():
-{}
-{
-  <IDENTIFIER> ( "[" "]" )*
-}
-
-void VariableInitializer():
-{}
-{
-  ArrayInitializer()
-|
-  Expression()
-}
-
-void ArrayInitializer():
-{}
-{
-  "{"								{ parser2.add(J_ARRAY_INIT_BEGIN, token); }
-  [ VariableInitializer() ( LOOKAHEAD(2) "," VariableInitializer() )* ] [ "," ]
-  "}"								{ parser2.add(J_ARRAY_INIT_END, token); }
-}
-
-void MethodDeclaration(int modifiers):
-{}
-{
-  // Modifiers already matched in the caller!
-  [ TypeParameters() ]
-  ResultType()
-  MethodDeclarator() [ "throws" NameList() ]
-      ( Block() | ";" )                 { parser2.add(J_METHOD_END, token); parser2.add(SEPARATOR_TOKEN, token); }
-}
-
-void MethodDeclarator():
-{}
-{
-  <IDENTIFIER>                          { parser2.add(SEPARATOR_TOKEN, token); parser2.add(J_METHOD_BEGIN, token); }
-  FormalParameters() ( "[" "]" )*
-}
-
-void FormalParameters():
-{}
-{
-  "(" [ FormalParameter() ( "," FormalParameter() )* ] ")"
-}
-
-void FormalParameter():
-{}
-{
-  ("final" | Annotation())* Type() [ "..." ] VariableDeclaratorId()
-}
-
-void ConstructorDeclaration():
-{}
-{
-  [ TypeParameters() ]
-  // Modifiers matched in the caller
-  <IDENTIFIER>                         { parser2.add(SEPARATOR_TOKEN, token); parser2.add(J_CONSTR_BEGIN, token); }
-  FormalParameters() [ "throws" NameList() ]
-  "{"
-    [ LOOKAHEAD(ExplicitConstructorInvocation()) ExplicitConstructorInvocation() ]
-    ( BlockStatement() )*
-  "}"                                  { parser2.add(J_CONSTR_END, token); parser2.add(SEPARATOR_TOKEN, token); }
-}
-
-void ExplicitConstructorInvocation():
-{}
-{
-  LOOKAHEAD("this" Arguments() ";")
-  "this"                               { parser2.add(J_APPLY, token); }
-  Arguments() ";"
-|
-  [ LOOKAHEAD(2) PrimaryExpression() "." ]
-  "super"                              { parser2.add(J_APPLY, token); }
-  Arguments() ";"
-}
-
-void Initializer():
-{}
-{
-  InitializerBegin()
-  ( BlockStatement() )* "}"            { parser2.add(J_INIT_END, token); }
-}
-
-void InitializerBegin():
-{}
-{
-  "static"							   { parser2.add(J_INIT_BEGIN, token); }
-  "{"
-|
-  "{"								   { parser2.add(J_INIT_BEGIN, token); }
-}
-
-/*
- * Type, name and expression syntax follows.
- */
-
-void Type():
-{}
-{
-   LOOKAHEAD(2) ReferenceType()
- |
-   PrimitiveType()
-}
-
-void ReferenceType():
-{}
-{
-   PrimitiveType() ( LOOKAHEAD(2) "[" "]" )+
-  |
-   ( ClassOrInterfaceType() ) ( LOOKAHEAD(2) "[" "]" )*
-}
-
-void ClassOrInterfaceType():
-{}
-{
-  <IDENTIFIER> [ LOOKAHEAD(2) TypeArguments() ]
-  ( LOOKAHEAD(2) "." <IDENTIFIER> [ LOOKAHEAD(2) TypeArguments() ] )*
-}
-
-void TypeArguments():
-{}
-{
-   "<" TypeArgument()                  { parser2.add(J_GENERIC, token); }
-   ( "," TypeArgument()                { parser2.add(J_GENERIC, token); }
-   )* ">"
-}
-
-void TypeArgument():
-{}
-{
-   ReferenceType()
- |
-   "?" [ WildcardBounds() ]
-}
-
-void WildcardBounds():
-{}
-{
-   "extends" ReferenceType()
- |
-   "super" ReferenceType()
-}
-
-
-void PrimitiveType():
-{}
-{
-  "boolean"
-|
-  "char"
-|
-  "byte"
-|
-  "short"
-|
-  "int"
-|
-  "long"
-|
-  "float"
-|
-  "double"
-}
-
-void ResultType():
-{}
-{
-  "void"                               { parser2.add(J_VOID, token); }
-|
-  Type()
-}
-
-void Name():
-/*
- * A lookahead of 2 is required below since "Name" can be followed
- * by a ".*" when used in the context of an "ImportDeclaration".
- */
-{}
-{
-  <IDENTIFIER>
-  ( LOOKAHEAD(2) "." <IDENTIFIER>
-  )*
-}
-
-void NameList():
-{}
-{
-  Name() ( "," Name() )*
-}
-
-
-/*
- * Expression syntax follows.
- */
-
-void 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.
- */
-{}
-{
-  ConditionalExpression()
-  [
-    LOOKAHEAD(2)
-    AssignmentOperator() Expression()
-  ]
-}
-
-void AssignmentOperator():
-{}
-{
-    ("=" | "*=" | "/=" | "%=" | "+=" | "-=" | "<<=" | ">>=" | ">>>=" | "&=" | "^=" | "|=")                                  { parser2.add(J_ASSIGN, token); }
-}
-
-void ConditionalExpression():
-{}
-{
-  ConditionalOrExpression()
-  [ "?"                                     { parser2.add(J_COND, token); }
-    Expression() ":" Expression() ]
-}
-
-void ConditionalOrExpression():
-{}
-{
-  ConditionalAndExpression() ( "||" ConditionalAndExpression() )*
-}
-
-void ConditionalAndExpression():
-{}
-{
-  InclusiveOrExpression() ( "&&" InclusiveOrExpression() )*
-}
-
-void InclusiveOrExpression():
-{}
-{
-  ExclusiveOrExpression() ( "|" ExclusiveOrExpression() )*
-}
-
-void ExclusiveOrExpression():
-{}
-{
-  AndExpression() ( "^" AndExpression() )*
-}
-
-void AndExpression():
-{}
-{
-  EqualityExpression() ( "&" EqualityExpression() )*
-}
-
-void EqualityExpression():
-{}
-{
-  InstanceOfExpression() ( ( "==" | "!=" ) InstanceOfExpression() )*
-}
-
-void InstanceOfExpression():
-{}
-{
-  RelationalExpression() [ "instanceof" Type() ]
-}
-
-void RelationalExpression():
-{}
-{
-  ShiftExpression() ( ( "<" | ">" | "<=" | ">=" ) ShiftExpression() )*
-}
-
-void ShiftExpression():
-{}
-{
-  AdditiveExpression() ( ( "<<" | RSIGNEDSHIFT() | RUNSIGNEDSHIFT() ) AdditiveExpression() )*
-}
-
-void AdditiveExpression():
-{}
-{
-  MultiplicativeExpression() ( ( "+" | "-" ) MultiplicativeExpression() )*
-}
-
-void MultiplicativeExpression():
-{}
-{
-  UnaryExpression() ( ( "*" | "/" | "%" ) UnaryExpression() )*
-}
-
-void UnaryExpression():
-{}
-{
-  ( "+" | "-" ) UnaryExpression()
-|
-  PreIncrementExpression()
-|
-  PreDecrementExpression()
-|
-  UnaryExpressionNotPlusMinus()
-}
-
-void PreIncrementExpression():
-{}
-{
-  "++"                                    { parser2.add(J_ASSIGN, token); }
-  PrimaryExpression()
-}
-
-void PreDecrementExpression():
-{}
-{
-  "--"                                    { parser2.add(J_ASSIGN, token); }
-  PrimaryExpression()
-}
-
-void UnaryExpressionNotPlusMinus():
-{}
-{
-  ( "~" | "!" ) UnaryExpression()
-|
-  LOOKAHEAD( CastLookahead() )
-  CastExpression()
-|
-  PostfixExpression()
-}
-
-// This production is to determine lookahead only.  The LOOKAHEAD specifications
-// below are not used, but they are there just to indicate that we know about
-// this.
-void CastLookahead():
-{}
-{
-  LOOKAHEAD(2)
-  "(" PrimitiveType()
-|
-  LOOKAHEAD("(" Type() "[")
-  "(" Type() "[" "]"
-|
-  "(" Type() ")" ( "~" | "!" | "(" | <IDENTIFIER> | "this" | "super" | "new" | Literal() )
-}
-
-void PostfixExpression():
-{}
-{
-  PrimaryExpression()
-  [ ( "++" | "--" )                       { parser2.add(J_ASSIGN, token); }
-  ]
-}
-
-void CastExpression():
-{}
-{
-  LOOKAHEAD("(" PrimitiveType())
-  "(" Type() ")" UnaryExpression()
-|
-  "(" Type() ")" UnaryExpressionNotPlusMinus()
-}
-
-void PrimaryExpression():
-{}
-{
-  PrimaryPrefix() ( LOOKAHEAD(2) PrimarySuffix() )*
-}
-
-void MemberSelector():
-{}
-{
-  "." TypeArguments() <IDENTIFIER>
-}
-
-void PrimaryPrefix():
-{}
-{
-  Literal()
-|
-  "this"
-|
-  "super" "." <IDENTIFIER>
-|
-  "(" Expression() ")"
-|
-  AllocationExpression()
-|
-  LOOKAHEAD( ResultType() "." "class" )
-  ResultType() "." "class"
-|
-  Name()
-}
-
-void PrimarySuffix():
-{}
-{
-(
-  LOOKAHEAD(2)
-  "." "this"
-|
-  LOOKAHEAD(2)
-  "." "super" "." <IDENTIFIER>
-|
-  LOOKAHEAD(2)
-  "." AllocationExpression()
-|
-  LOOKAHEAD(3)
-  MemberSelector()
-|
-  "[" Expression() "]"
-|
-  "." <IDENTIFIER>
-|
-  	{ parser2.add(J_APPLY, token); }
-  Arguments()
-)
-}
-
-void Literal():
-{}
-{
-  <INTEGER_LITERAL>
-|
-  <FLOATING_POINT_LITERAL>
-|
-  <CHARACTER_LITERAL>
-|
-  <STRING_LITERAL>
-|
-  BooleanLiteral()
-|
-  NullLiteral()
-}
-
-void BooleanLiteral():
-{}
-{
-  "true"
-|
-  "false"
-}
-
-void NullLiteral():
-{}
-{
-  "null"
-}
-
-void Arguments():
-{}
-{
-  "(" [ ArgumentList() ] ")"
-}
-
-void ArgumentList():
-{}
-{
-  Expression() ( "," Expression() )*
-}
-
-void AllocationExpression():
-{
-  Token x;
-}
-{
-  LOOKAHEAD(2)
-  "new"                                     { parser2.add(J_NEWARRAY, token); }
-  PrimitiveType() ArrayDimsAndInits()
-|
-  x="new"
-  ClassOrInterfaceType() [ TypeArguments() ]
-    (                                       { parser2.add(J_NEWARRAY, x); }
-      ArrayDimsAndInits()
-    |										{ parser2.add(J_NEWCLASS, x); }
-      Arguments()
-      [
-        "{"                           { parser2.add(J_IN_CLASS_BEGIN, token); }
-        ( ClassOrInterfaceBodyDeclaration(false) )* "}"
-        							  { parser2.add(J_IN_CLASS_END, token); }
-      ]
-    )
-}
-
-/*
- * The third LOOKAHEAD specification below is to parse to PrimarySuffix
- * if there is an expression between the "[...]".
- */
-void ArrayDimsAndInits():
-{}
-{
-  LOOKAHEAD(2)
-  ( LOOKAHEAD(2) "[" Expression() "]" )+ ( LOOKAHEAD(2) "[" "]" )*
-|
-  ( "[" "]" )+ ArrayInitializer()
-}
-
-
-/*
- * Statement syntax follows.
- */
-
-void Statement():
-{}
-{
-  LOOKAHEAD(2)
-  LabeledStatement()
-|
-  AssertStatement()
-|
-  Block()
-|
-  EmptyStatement()
-|
-  StatementExpression() ";"
-|
-  SwitchStatement()
-|
-  IfStatement()
-|
-  WhileStatement()
-|
-  DoStatement()
-|
-  ForStatement()
-|
-  BreakStatement()
-|
-  ContinueStatement()
-|
-  ReturnStatement()
-|
-  ThrowStatement()
-|
-  SynchronizedStatement()
-|
-  TryStatement()
-}
-
-void AssertStatement():
-{}
-{
-  "assert"                                  { parser2.add(J_ASSERT, token); }
-  Expression() [ ":" Expression() ] ";"
-}
-
-void LabeledStatement():
-{}
-{
-  <IDENTIFIER> ":" Statement()
-}
-
-void Block():
-{}
-{
-  "{" ( BlockStatement() )* "}"
-}
-
-void BlockStatement():
-{}
-{
-  LOOKAHEAD(("final" | Annotation())* Type() <IDENTIFIER>)
-  LocalVariableDeclaration() ";"
-|
-  Statement()
-|
-  ClassOrInterfaceDeclaration(0)
-}
-
-void LocalVariableDeclaration():
-{}
-{
-  ("final" | Annotation())* Type() VariableDeclarator() ( "," VariableDeclarator() )*
-}
-
-void EmptyStatement():
-{}
-{
-  ";"
-}
-
-void 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.
- */
-{}
-{
-  PreIncrementExpression()
-|
-  PreDecrementExpression()
-|
-  PrimaryExpression()
-  [
-    "++"                               { parser2.add(J_ASSIGN, token); }
-  |
-    "--"                               { parser2.add(J_ASSIGN, token); }
-  |
-    AssignmentOperator() Expression()
-  ]
-}
-
-void SwitchStatement():
-{}
-{
-  "switch"                             { parser2.add(J_SWITCH_BEGIN, token); }
-  "(" Expression() ")" "{"
-    ( SwitchLabel()
-      ( BlockStatement() )*
-    )*
-  "}"                                  { parser2.add(J_SWITCH_END, token); }
-}
-
-void SwitchLabel():
-{}
-{
-  "case"							   { parser2.add(J_CASE, token); }
-  Expression() ":"
-|
-  "default"							   { parser2.add(J_CASE, token); }
-  ":"
-}
-
-void 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.
- */
-{}
-{
-  "if"                                 { parser2.add(J_IF_BEGIN, token); }
-  "(" Expression() ")" Statement()
-  [ LOOKAHEAD(1) "else"                { parser2.add(J_ELSE, token); }
-    Statement() ]
-                                       { parser2.add(J_IF_END, token); }
-}
-
-void WhileStatement():
-{}
-{
-  "while"                              { parser2.add(J_WHILE_BEGIN, token); }
-  "(" Expression() ")" Statement()     { parser2.add(J_WHILE_END, token); }
-}
-
-void DoStatement():
-{}
-{
-  "do"                                 { parser2.add(J_DO_BEGIN, token); }
-  Statement() "while" "(" Expression() ")" ";"
-                                       { parser2.add(J_DO_END, token); }
-}
-
-void ForStatement():
-{}
-{
-  "for"                                { parser2.add(J_FOR_BEGIN, token); }
-  "("
-  (
-      LOOKAHEAD(("final" | Annotation())* Type() <IDENTIFIER> ":")
-      ("final" | Annotation())* Type() <IDENTIFIER>
-      ":" Expression() 
-    |
-     [ ForInit() ] ";" [ Expression() ] ";" [ ForUpdate() ]
-  )
-
-  ")" Statement()
-                                       { parser2.add(J_FOR_END, token); }
-}
-
-void ForInit():
-{}
-{
-  LOOKAHEAD( [ "final" ] Type() <IDENTIFIER> )
-  LocalVariableDeclaration()
-|
-  StatementExpressionList()
-}
-
-void StatementExpressionList():
-{}
-{
-  StatementExpression() ( "," StatementExpression() )*
-}
-
-void ForUpdate():
-{}
-{
-  StatementExpressionList()
-}
-
-void BreakStatement():
-{}
-{
-  "break"                              { parser2.add(J_BREAK, token); }
-  [ <IDENTIFIER> ] ";"
-}
-
-void ContinueStatement():
-{}
-{
-  "continue"                           { parser2.add(J_CONTINUE, token); }
-  [ <IDENTIFIER> ] ";"
-}
-
-void ReturnStatement():
-{}
-{
-  "return"							   { parser2.add(J_RETURN, token); }
-  [ Expression() ] ";"
-}
-
-void ThrowStatement():
-{}
-{
-  "throw"                              { parser2.add(J_THROW, token); }
-  Expression() ";"
-}
-
-void SynchronizedStatement():
-{}
-{
-  "synchronized"                       { parser2.add(J_SYNC_BEGIN, token); }
-  "(" Expression() ")" Block()         { parser2.add(J_SYNC_END, token); }
-}
-
-void TryStatement():
-/*
- * Semantic check required here to make sure that at least one
- * finally/catch is present.
- */
-{}
-{
-  "try"                                { parser2.add(J_TRY_BEGIN, token); }
-  Block()
-  ( "catch"                            { parser2.add(J_CATCH_BEGIN, token); }
-    "(" FormalParameter() ")" Block() )*
-  [ "finally"                          { parser2.add(J_FINALLY, token); }
-    Block() ]                          { parser2.add(J_CATCH_END, token); }
-}
-
-/* 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 &&
-                ((Token.GTToken)getToken(1)).realKind == RUNSIGNEDSHIFT} )
-   ">" ">" ">"
-  )
-}
-
-void RSIGNEDSHIFT():
-{}
-{
-  ( LOOKAHEAD({ getToken(1).kind == GT &&
-                ((Token.GTToken)getToken(1)).realKind == RSIGNEDSHIFT} )
-  ">" ">"
-  )
-}
-
-/* Annotation syntax follows. */
-
-void Annotation():
-{}
-{
-   LOOKAHEAD( "@" Name() "(" ( <IDENTIFIER> "=" | ")" ))
-   NormalAnnotation()
- |
-   LOOKAHEAD( "@" Name() "(" )
-   SingleMemberAnnotation()
- |
-   MarkerAnnotation()
-}
-
-void NormalAnnotation():
-{}
-{
-   "@"                                  { parser2.add(J_ANNO, token); }
-   Name()
-   "(" [ MemberValuePairs() ] ")"
-}
-
-void MarkerAnnotation():
-{}
-{
-  "@"                                   { parser2.add(J_ANNO_MARKER, token); }
-  Name()
-}
-
-void SingleMemberAnnotation():
-{}
-{
-  "@"                                   { parser2.add(J_ANNO, token); }
-  Name() "(" MemberValue() ")"
-}
-
-void MemberValuePairs():
-{}
-{
-   MemberValuePair() ( "," MemberValuePair() )*
-}
-
-void MemberValuePair():
-{}
-{
-    <IDENTIFIER> "=" MemberValue()
-}
-
-void MemberValue():
-{}
-{
-   Annotation()
- |
-   MemberValueArrayInitializer()
- |
-   ConditionalExpression()
-}
-
-void  MemberValueArrayInitializer():
-{}
-{
-  "{"                                   { parser2.add(J_ANNO_M_BEGIN, token); }
-  MemberValue() ( LOOKAHEAD(2) "," MemberValue() )* [ "," ]
-  "}"                                   { parser2.add(J_ANNO_M_END, token); }
-}
-
-
-/* Annotation Types. */
-
-void AnnotationTypeDeclaration(int modifiers):
-{}
-{
-  "@"                                   { parser2.add(J_ANNO_T_BEGIN, token); }
-  "interface" <IDENTIFIER> AnnotationTypeBody()
-                                        { parser2.add(J_ANNO_T_END, token); }
-}
-
-void AnnotationTypeBody():
-{}
-{
-  "{" ( AnnotationTypeMemberDeclaration() )* "}"
-}
-
-void AnnotationTypeMemberDeclaration():
-{
-   int modifiers;
-}
-{
- modifiers = Modifiers()
- (
-   LOOKAHEAD(Type() <IDENTIFIER> "(")
-   Type() <IDENTIFIER>
-   "(" ")" [ DefaultValue() ] ";"
-  |
-                                        { parser2.add(J_ANNO_C_BEGIN, token); }
-   ClassOrInterfaceDeclaration(modifiers)
-                                        { parser2.add(J_ANNO_C_END, token); }
-  |
-   EnumDeclaration(modifiers)
-  |
-   AnnotationTypeDeclaration(modifiers)
-  |
-   FieldDeclaration(modifiers)
- )
- |
-   ( ";" )
-}
-
-void DefaultValue():
-{}
-{
-  "default" MemberValue()
-}

+ 0 - 87
jplag.frontend.java-1.7/pom.xml

@@ -1,87 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <artifactId>java-1.7</artifactId>
-  <version>0.0.1-SNAPSHOT</version>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>build-helper-maven-plugin</artifactId>
-        <version>3.2.0</version>
-        <configuration>
-          <sources>
-            <source>target/generated-sources/antlr4</source>
-          </sources>
-        </configuration>
-        <executions>
-          <execution>
-            <id>generate-antlr-sources</id>
-            <phase>generate-sources</phase>
-            <goals>
-              <goal>add-source</goal>
-            </goals>
-          </execution>
-          <execution>
-            <id>compile-with-antlr-sources</id>
-            <phase>compile</phase>
-            <goals>
-              <goal>add-source</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-
-      <plugin>
-        <groupId>org.antlr</groupId>
-        <artifactId>antlr4-maven-plugin</artifactId>
-        <version>4.9.3</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>antlr4</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-jar-plugin</artifactId>
-        <configuration>
-          <archive>
-            <manifest>
-              <mainClass>de.jplag.java17.Parser</mainClass>
-              <packageName>jplag.java17</packageName>
-            </manifest>
-          </archive>
-        </configuration>
-      </plugin>
-
-    </plugins>
-  </build>
-
-  <dependencies>
-    <dependency>
-      <groupId>de.jplag</groupId>
-      <artifactId>frontend-utils</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.antlr</groupId>
-      <artifactId>antlr4-runtime</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>de.jplag</groupId>
-      <artifactId>java-1.5</artifactId>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-  <parent>
-    <groupId>de.jplag</groupId>
-    <artifactId>parent</artifactId>
-    <version>0.3-SNAPSHOT</version>
-    <relativePath>../jplag.parent/pom.xml</relativePath>
-  </parent>
-</project>

+ 0 - 765
jplag.frontend.java-1.7/src/main/antlr4/de/jplag/java17/grammar/Java7.g4

@@ -1,765 +0,0 @@
-/*
- [The "BSD licence"]
- Copyright (c) 2012 George S. Cowan
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- 1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
- 3. The name of the author may not be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-
-/** Java 7 grammar for Antlr 4
-    Based on Terence Parr's Java 6 grammar at
-      https://github.com/antlr/grammars-v4/tree/master/java
-    with changes from the Java 7 Language Specification
-      http://docs.oracle.com/javase/specs/jls/se7/jls7.pdf
-    but with my own refactorings.
-  */
-grammar Java7;
-
-/* the keywords enum and assert have compiler options to allow their use as
-   identifiers instead. This presents a problem best solved with
-   implementation dependent code. I have commented out a Java solution.
- */
-// @lexer::members {
-//   protected boolean enumIsKeyword = true;  // A subclass of Java7Parser.java can
-//   protected boolean assertIsKeyword = true;// accept parameters and override these
-// }
-
-/*******************************************************************************
-        Parser section -
-*******************************************************************************/
-
-compilationUnit
-  : packageDeclaration? importDeclaration* typeDeclaration* EOF
-  ;
-
-packageDeclaration
-  : annotation* 'package' qualifiedIdentifier ';'
-  ;
-
-importDeclaration
-  : 'import' 'static'? qualifiedIdentifier ('.' '*')? ';'
-  ;
-
-typeDeclaration
-  : classOrInterfaceDeclaration
-  | ';'
-  ;
-
-classOrInterfaceDeclaration
-  : modifier* (classDeclaration | interfaceDeclaration)
-  ;
-
-
-classDeclaration
-  : normalClassDeclaration
-  | enumDeclaration
-  ;
-
-normalClassDeclaration
-  : 'class' Identifier typeParameters?
-    ('extends' typeRef)?
-    ('implements' typeList)?
-    classBody
-  ;
-
-typeParameters
-  : '<' typeParameter (',' typeParameter)* '>'
-  ;
-
-typeParameter
-  : Identifier ('extends' bound)?
-  ;
-
-bound
-  : classOrInterfaceType ('&' classOrInterfaceType)*
-  ;
-
-enumDeclaration
-  : ENUM Identifier ('implements' typeList)?
-    '{' enumConstants?
-        ( ';' classBodyDeclaration* )?
-    '}'
-  ;
-
-enumConstants
-  // The comma after the last enumConstant is optional.
-  // Oddly, there may also be a comma without any enumConstants
-  : enumConstant (',' enumConstant)* ','?
-  | ','
-  ;
-
-interfaceDeclaration
-  : normalInterfaceDeclaration
-  | annotationTypeDeclaration
-  ;
-normalInterfaceDeclaration
-  : 'interface' Identifier typeParameters? ('extends' typeList)? interfaceBody
-  ;
-
-classBody
-  :   '{' classBodyDeclaration* '}'
-  ;
-
-interfaceBody
-  : '{'
-       ( modifier* interfaceMemberDecl | ';' )*
-    '}'
-  ;
-
-classBodyDeclaration
-  : ';'                             #cbdSemicolon
-  | modifier* memberDecl            #cbdMember
-  | 'static'? block                 #cbdBlock
-  ;
-
-memberDecl
-  : methodDeclaration // generic and void methods are here, too
-  | fieldDeclaration
-  | constructorDeclaration
-  | interfaceDeclaration
-  | classDeclaration
-  ;
-
-fieldDeclaration
-  : typeRef variableDeclarators ';'
-  ;
-
-block
-  : '{' blockStatement* '}'
-  ;
-
-blockStatement
-  : localVariableDeclaration ';'
-  | classOrInterfaceDeclaration
-  | statement
-  ;
-
-enumConstant
-  : annotation* Identifier arguments? classBody?
-  ;
-
-typeList
-  : classOrInterfaceType (',' classOrInterfaceType)*
-  ;
-
-typeArguments
-  : '<' typeArgument (',' typeArgument)* '>'
-  ;
-
-typeArgument
-  : classOrInterfaceType ('[' ']')* // array types are allowed here, as an type argument
-  | '?' (('extends' | 'super') classOrInterfaceType)?
-  ;
-
-interfaceMemberDecl
-  : interfaceMethodOrFieldDecl
-  | interfaceGenericMethodDecl
-  | 'void' Identifier voidInterfaceMethodDeclaratorRest
-  | interfaceDeclaration
-  | classDeclaration
-  ;
-
-
-/** Allows brackets after parameters for backwards compatibility only; do not use. */
-methodDeclaration
-  : typeParameters? (typeRef | 'void')
-    Identifier formalParameters ('[' ']')*   ('throws' qualifiedIdentifierList)?
-    ( methodBody
-    | ';'
-    )
-  ;
-
-constructorDeclaration
-  : typeParameters? Identifier formalParameters ('throws' qualifiedIdentifierList)?
-    '{'
-        explicitConstructorInvocation?
-        blockStatement*
-    '}'
-  ;
-
-variableModifier
-  : 'final'
-  | annotation
-  ;
-
-interfaceMethodOrFieldDecl
-  : typeRef Identifier interfaceMethodOrFieldRest
-  ;
-
-interfaceMethodOrFieldRest
-  : constantDeclaratorsRest ';'
-  | interfaceMethodDeclaratorRest
-  ;
-
-interfaceMethodDeclaratorRest
-  : formalParameters ('[' ']')* ('throws' qualifiedIdentifierList)? ';'
-  ;
-
-interfaceGenericMethodDecl
-  : typeParameters (typeRef | 'void') Identifier
-    interfaceMethodDeclaratorRest
-  ;
-
-voidInterfaceMethodDeclaratorRest
-  : formalParameters ('throws' qualifiedIdentifierList)? ';'
-  ;
-
-constantDeclarator
-  : Identifier constantDeclaratorRest
-  ;
-
-variableDeclarators
-  : variableDeclarator (',' variableDeclarator)*
-  ;
-
-variableDeclarator
-  : variableDeclaratorId ('=' variableInitializer)?
-  ;
-
-constantDeclaratorsRest
-  : constantDeclaratorRest (',' constantDeclarator)*
-  ;
-
-constantDeclaratorRest
-  : ('[' ']')* '=' variableInitializer
-  ;
-
-variableDeclaratorId
-  : Identifier ('[' ']')*
-  ;
-
-variableInitializer
-  : arrayInitializer
-  | expression
-  ;
-
-arrayInitializer
-  : '{' ( variableInitializer (',' variableInitializer)* (',')?
-        )?
-    '}'
-  ;
-
-modifier
-  : annotation
-  | 'public'
-  | 'protected'
-  | 'private'
-  | 'static'
-  | 'abstract'
-  | 'final'       // not for interface or annotation declarations
-  | 'native'
-  | 'synchronized'
-  | 'transient'
-  | 'volatile'
-  | 'strictfp'
-  ;
-
-packageOrTypeName
-  : qualifiedIdentifier
-  ;
-
-enumConstantName
-  : Identifier
-  ;
-
-typeName
-  : qualifiedIdentifier
-  ;
-
-typeRef
-  : classOrInterfaceType ('[' ']')*
-  | primitiveType ('[' ']')*
-  ;
-
-/** classOrInterfaceType is not used in the Java 7 Language Specification. We use
-    it as a substitute name for the ReferenceType that is defined in the Syntax
-    section (Chapter 18, p. 593). The reason that we do not just use the rule name
-    referenceType instead of classOrInterfaceType is that elsewhere in the
-    Java 7 Reference (topic 4.3, p.52), ReferenceType is defined differently.
-    We are doing our best here to avoid confusion.
-  */
-classOrInterfaceType
-  : Identifier typeArguments? ( '.' Identifier typeArguments? )*
-  ;
-
-primitiveType
-  : 'boolean'
-  | 'char'
-  | 'byte'
-  | 'short'
-  | 'int'
-  | 'long'
-  | 'float'
-  | 'double'
-  ;
-
-qualifiedIdentifierList
-  : qualifiedIdentifier (',' qualifiedIdentifier)*
-  ;
-
-formalParameters
-  : '(' formalParameterDeclarations? ')'
-  ;
-
-formalParameterDeclarations
-  : variableModifier* typeRef formalParameterVariables
-  ;
-
-formalParameterVariables
-  : '...' variableDeclaratorId // variable-arity parameter must be the last one
-  | variableDeclaratorId (',' formalParameterDeclarations)?
-  ;
-
-methodBody
-  : block
-  ;
-
-explicitConstructorInvocation
-  : nonWildcardTypeArguments? ('this' | 'super') arguments ';'
-  | primary '.' nonWildcardTypeArguments? 'super' arguments ';'
-  ;
-
-qualifiedIdentifier
-  : Identifier ('.' Identifier)*
-  ;
-literal
-  : integerLiteral
-  | FloatingPointLiteral
-  | CharacterLiteral
-  | StringLiteral
-  | booleanLiteral
-  | 'null'
-  ;
-
-integerLiteral
-  : HexLiteral
-  | OctalLiteral
-  | DecimalLiteral
-  | BinaryLiteral
-  ;
-
-booleanLiteral
-  : 'true'
-  | 'false'
-  ;
-
-// ANNOTATIONS
-
-annotation
-  : '@' annotationName ( '(' ( elementValuePairs | elementValue )? ')' )?
-  ;
-
-annotationName
-  : Identifier ('.' Identifier)*
-  ;
-
-elementValuePairs
-  : elementValuePair (',' elementValuePair)*
-  ;
-
-elementValuePair
-  : Identifier '=' elementValue
-  ;
-
-elementValue
-  : expression
-  | annotation
-  | elementValueArrayInitializer
-  ;
-
-elementValueArrayInitializer
-  : '{' (elementValue (',' elementValue)*)? (',')? '}'
-  ;
-
-annotationTypeDeclaration
-  : '@' 'interface' Identifier
-    '{'
-       (modifier* annotationTypeElement)*
-    '}'
-  ;
-
-annotationTypeElement
-  : typeRef (annotationMethod | variableDeclarators) ';'
-  | classDeclaration ';'?
-  | normalInterfaceDeclaration ';'?
-  | enumDeclaration ';'?
-  | annotationTypeDeclaration ';'?
-  ;
-
-annotationMethod
-  : Identifier '(' ')' defaultValue?
-  ;
-
-defaultValue
-  : 'default' elementValue
-  ;
-
-// STATEMENTS / BLOCKS
-
-localVariableDeclaration
-  : variableModifier* typeRef variableDeclarators
-  ;
-
-statement
-  : block                                                   #blockStmt
-  | ASSERT expression (':' expression)? ';'                 #assertStmt
-  | 'if' parExpression statement ('else' statement)?        #ifStmt
-  | 'for' '(' forControl ')' statement                      #forStmt
-  | 'while' parExpression statement                         #whileStmt
-  | 'do' statement 'while' parExpression ';'                #doWhileStmt
-  | tryStatement                                            #tryStmt
-  | 'switch' parExpression switchBlock                      #switchStmt
-  | 'synchronized' parExpression block                      #synchronizedStmt
-  | 'return' expression? ';'                                #returnStmt
-  | 'throw' expression ';'                                  #throwStmt
-  | 'break' Identifier? ';'                                 #break
-  | 'continue' Identifier? ';'                              #continueStmt
-  | ';'                                                     #semicStmt
-  | statementExpression ';'                                 #statementExpressStmt
-  | Identifier ':' statement                                #identifiedStmt
-  ;
-
-tryStatement
-  // must contain at least one resource, catch, or finally
-  : 'try' '(' resources ')' block   catchClause* ('finally' block)?
-  | 'try'                   block ( catchClause+ ('finally' block)?
-                                  |               'finally' block
-                                  )
-  ;
-
-catchClause
-  : 'catch' '(' variableModifier* typeRef ('|' typeRef)* Identifier ')' block
-  ;
-
-resources
-  // Semicolon may be ommited for last resource
-  : resource (';' resource)* ';'?
-  ;
-
-resource
-  : variableModifier* classOrInterfaceType variableDeclaratorId '=' expression
-  ;
-
-switchBlock
-  : '{' switchBlockStatementGroup* switchLabel* '}'
-  ;
-
-switchBlockStatementGroup
-  : switchLabel+ blockStatement*
-  ;
-
-switchLabel
-  : 'case' constantExpression ':'
-  | 'case' enumConstantName ':'
-  | 'default' ':'
-  ;
-
-forControl
-  : enhancedForControl
-  | forInit? ';' expression? ';' forUpdate?
-  ;
-
-forInit
-  : localVariableDeclaration
-  | expressionList
-  ;
-
-enhancedForControl
-  : variableModifier* typeRef Identifier ':' expression
-  ;
-
-forUpdate
-  : expressionList
-  ;
-
-// EXPRESSIONS
-
-parExpression
-  : '(' expression ')'
-  ;
-
-expressionList
-  : expression (',' expression)*
-  ;
-
-statementExpression
-  : expression
-  ;
-
-constantExpression
-  : expression
-  ;
-
-expression
-  : primary                                                             #exprPrimary
-  | expression '.' Identifier                                           #exprIdentifier
-  | expression '.' 'this'                                               #exprThis
-  | expression '.' 'super' '(' expressionList? ')'                      #exprSuper
-  | expression '.' 'new' Identifier '(' expressionList? ')'             #exprNewIdentidier
-  | expression '.' 'super' '.' Identifier arguments?                    #exprSuperIdentifier
-  | expression '.' explicitGenericInvocation                            #exprExplicitGenericInvocation
-  | expression '[' expression ']'                                       #exprArrayExpression
-  | expression '(' expressionList? ')'                                  #exprMethodExpressionList
-  | expression ('++' | '--')                                            #exprExpressionIncDec
-  | ('+'|'-'|'++'|'--') expression                                      #exprIncDecExpression
-  | ('~'|'!') expression                                                #exprNotExpression
-  | '(' typeRef ')' expression                                          #exprCastExpression
-  | 'new' creator                                                       #exprNewCreator
-  | expression ('*'|'/'|'%') expression                                 #exprBinaryOperatorMult
-  | expression ('+'|'-') expression                                     #exprBinaryOperatorAdd
-  | expression ('<' '<' | '>' '>' '>' | '>' '>') expression             #exprBinaryOperatorComp
-  | expression ('<' '=' | '>' '=' | '>' | '<') expression               #exprBinaryOperatorGT
-  | expression 'instanceof' typeRef                                     #exprBinaryOperatorInstanceof
-  | expression ('==' | '!=') expression                                 #exprBinaryEquals
-  | expression '&' expression                                           #exprBinaryAnd
-  | expression '^' expression                                           #exprBinaryNot
-  | expression '|' expression                                           #exprBinaryOr
-  | expression '&&' expression                                          #exprBinaryBoolAnd
-  | expression '||' expression                                          #exprBinaryBoolOr
-  | expression '?' expression ':' expression                            #exprConditionalExpression
-  | expression                                                          
-    ( '^='            <assoc=right>
-    | '+='            <assoc=right>
-    | '-='            <assoc=right>
-    | '*='            <assoc=right>
-    | '/='            <assoc=right>
-    | '&='            <assoc=right>
-    | '|='            <assoc=right>
-    | '='             <assoc=right>
-    | '>' '>' '='     <assoc=right>
-    | '>' '>' '>' '=' <assoc=right>
-    | '<' '<' '='     <assoc=right>
-    | '%='            <assoc=right>
-    )
-    expression                                                          #exprAssignment
-  ;
-
-primary
-  : '(' expression ')'
-  | 'this'
-  | 'super'
-  | literal
-  | Identifier
-  | typeRef '.' 'class'
-  | 'void' '.' 'class'
-  ;
-
-creator
-  : nonWildcardTypeArguments createdName classCreatorRest
-  | createdName (arrayCreatorRest | classCreatorRest)
-  ;
-
-createdName
-  : primitiveType
-  | // classOrInterfaceType but with possible <>
-    Identifier (typeArguments | '<' '>')? ('.' Identifier (typeArguments | '<' '>')? )*
-  ;
-
-innerCreator
-  : (nonWildcardTypeArguments | '<' '>')? Identifier classCreatorRest
-  ;
-
-explicitGenericInvocation
-  : nonWildcardTypeArguments Identifier arguments
-  ;
-
-arrayCreatorRest
-  : '['
-    (   ']' ('[' ']')* arrayInitializer
-    |   expression ']' ('[' expression ']')* ('[' ']')*
-    |   ']'
-    )
-  ;
-
-classCreatorRest
-  : arguments classBody?
-  ;
-
-nonWildcardTypeArguments
-  : '<' typeList '>'
-  ;
-
-arguments
-  : '(' expressionList? ')'
-  ;
-
-
-// LEXER =====================================================
-
-HexLiteral
-  // underscores may be freely inserted after first hex digit and before last
-  : '0' ('x'|'X')
-    HexDigits
-    IntegerTypeSuffix?
-  ;
-
-DecimalLiteral
-  // Only a single zero digit may begin with a zero
-  // Underscores may be freely inserted after first digit and before last
-  : ( '0' | '1'..'9' ('_'* Digit)* ) IntegerTypeSuffix?
-  ;
-
-OctalLiteral
-  // Underscores may be freely inserted before the last digit.
-  // Don't know why underscores here are different from others -
-  // Maybe the leading 0 is considered a digit as well as a marker
-  // indicating that the following is a base 8 number
-  : '0' ('_'* '0'..'7')+ IntegerTypeSuffix?
-  ;
-
-BinaryLiteral
-  // underscores may be freely inserted after first digit and before last
-  : '0' ('b'|'B')
-    BinaryDigit ('_'* BinaryDigit)*
-    IntegerTypeSuffix?
-  ;
-
-fragment
-BinaryDigit : ('0'|'1') ;
-
-fragment
-HexDigits : HexDigit ('_'* HexDigit)* ;
-
-fragment
-HexDigit : (Digit|'a'..'f'|'A'..'F') ;
-
-fragment
-Digits : Digit ('_'* Digit)* ;
-
-fragment
-Digit : '0'..'9' ;
-
-fragment
-IntegerTypeSuffix : ('l'|'L') ;
-
-FloatingPointLiteral
-  : Digits '.' Digits? Exponent? FloatTypeSuffix?
-  | '.' Digits Exponent? FloatTypeSuffix?
-  | Digits Exponent FloatTypeSuffix?
-  | Digits FloatTypeSuffix
-
-    // Hex float literal
-  | ('0x' | '0X')
-    HexDigits? ('.' HexDigits?)?
-    ( 'p' | 'P' ) ( '+' | '-' )? Digits // note decimal exponent
-    FloatTypeSuffix?
-  ;
-
-fragment
-Exponent : ('e'|'E') ('+'|'-')? Digits ;
-
-fragment
-FloatTypeSuffix : ('f'|'F'|'d'|'D') ;
-
-CharacterLiteral
-  : '\'' ( EscapeSequence | ~('\''|'\\') ) '\''
-  ;
-
-StringLiteral
-  :  '"' ( EscapeSequence | ~('\\'|'"') )* '"'
-  ;
-
-fragment
-EscapeSequence
-  : '\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\')
-  | UnicodeEscape
-  | OctalEscape
-  ;
-
-fragment
-OctalEscape
-  : '\\' ('0'..'3') ('0'..'7') ('0'..'7')
-  | '\\' ('0'..'7') ('0'..'7')
-  | '\\' ('0'..'7')
-  ;
-
-fragment
-UnicodeEscape
-  : '\\' 'u' HexDigit HexDigit HexDigit HexDigit
-  ;
-
-ENUM
-  : 'enum' // {if (!enumIsKeyword) setType(Identifier);}
-  ;
-
-ASSERT
-  : 'assert' // {if (!assertIsKeyword) setType(Identifier);}
-  ;
-
-Identifier
-  : Letter (Letter|JavaIDDigit)*
-  ;
-
-/**I found this char range in JavaCC's grammar, but Letter and Digit overlap.
-   Still works, but...
- */
-fragment
-Letter
-  : '\u0024'                 // $
-  | '\u0041'..'\u005a'       // A-Z
-  | '\u005f'                 // _
-  | '\u0061'..'\u007a'       // a-z
-  | '\u00c0'..'\u00d6'       // Latin Capital Letter A with grave - Latin Capital letter O with diaeresis
-  | '\u00d8'..'\u00f6'       // Latin Capital letter O with stroke - Latin Small Letter O with diaeresis
-  | '\u00f8'..'\u00ff'       // Latin Small Letter O with stroke - Latin Small Letter Y with diaeresis
-  | '\u0100'..'\u1fff'       // Latin Capital Letter A with macron - Latin Small Letter O with stroke and acute
-  | '\u3040'..'\u318f'       // Hiragana
-  | '\u3300'..'\u337f'       // CJK compatibility
-  | '\u3400'..'\u3d2d'       // CJK compatibility
-  | '\u4e00'..'\u9fff'       // CJK compatibility
-  | '\uf900'..'\ufaff'       // CJK compatibility
-  ;
-
-fragment
-JavaIDDigit
-  : '\u0030'..'\u0039'       // 0-9
-  | '\u0660'..'\u0669'       // Arabic-Indic Digit 0-9
-  | '\u06f0'..'\u06f9'       // Extended Arabic-Indic Digit 0-9
-  | '\u0966'..'\u096f'       // Devanagari 0-9
-  | '\u09e6'..'\u09ef'       // Bengali 0-9
-  | '\u0a66'..'\u0a6f'       // Gurmukhi 0-9
-  | '\u0ae6'..'\u0aef'       // Gujarati 0-9
-  | '\u0b66'..'\u0b6f'       // Oriya 0-9
-  | '\u0be7'..'\u0bef'       // Tami 0-9
-  | '\u0c66'..'\u0c6f'       // Telugu 0-9
-  | '\u0ce6'..'\u0cef'       // Kannada 0-9
-  | '\u0d66'..'\u0d6f'       // Malayala 0-9
-  | '\u0e50'..'\u0e59'       // Thai 0-9
-  | '\u0ed0'..'\u0ed9'       // Lao 0-9
-  | '\u1040'..'\u1049'       // Myanmar 0-9?
-  ;
-
-WS
-  : [ \r\t\u000C\n]+ -> channel(HIDDEN)
-  ;
-
-COMMENT
-  : '/*' .*? '*/'    -> channel(HIDDEN)
-  ;
-
-LINE_COMMENT
-  : '//' ~[\r\n]* -> channel(HIDDEN)
-  ;
-

+ 0 - 174
jplag.frontend.java-1.7/src/main/java/de/jplag/java17/JavaToken.java

@@ -1,174 +0,0 @@
-package de.jplag.java17;
-
-import de.jplag.Token;
-
-public class JavaToken extends Token implements JavaTokenConstants {
-	private static final long serialVersionUID = -383581430479870696L;
-	private int line, column, length;
-
-	public JavaToken(int type, String file, int line, int column, int length) {
-		super(type, file, line, column, length);
-	}
-
-	@Override
-    public int getLine() {
-		return line;
-	}
-
-	@Override
-    public int getColumn() {
-		return column;
-	}
-
-	@Override
-    public int getLength() {
-		return length;
-	}
-
-	@Override
-    public void setLine(int line) {
-		this.line = line;
-	}
-
-	@Override
-    public void setColumn(int column) {
-		this.column = column;
-	}
-
-	@Override
-    public void setLength(int length) {
-		this.length = length;
-	}
-
-	public static String type2string(int type) {
-		switch (type) {
-		case JavaTokenConstants.FILE_END:
-			return "********";
-		case JavaTokenConstants.SEPARATOR_TOKEN:
-			return "METHOD_SEPARATOR";
-		case J_PACKAGE:
-			return "PACKAGE ";
-		case J_IMPORT:
-			return "IMPORT  ";
-		case J_CLASS_BEGIN:
-			return "CLASS{  ";
-		case J_CLASS_END:
-			return "}CLASS  ";
-		case J_METHOD_BEGIN:
-			return "METHOD{ ";
-		case J_METHOD_END:
-			return "}METHOD ";
-		case J_VARDEF:
-			return "VARDEF  ";
-		case J_SYNC_BEGIN:
-			return "SYNC{   ";
-		case J_SYNC_END:
-			return "}SYNC   ";
-		case J_DO_BEGIN:
-			return "DO{     ";
-		case J_DO_END:
-			return "}DO     ";
-		case J_WHILE_BEGIN:
-			return "WHILE{  ";
-		case J_WHILE_END:
-			return "}WHILE  ";
-		case J_FOR_BEGIN:
-			return "FOR{    ";
-		case J_FOR_END:
-			return "}FOR    ";
-		case J_SWITCH_BEGIN:
-			return "SWITCH{ ";
-		case J_SWITCH_END:
-			return "}SWITCH ";
-		case J_CASE:
-			return "CASE    ";
-		case J_TRY_BEGIN:
-			return "TRY{    ";
-		case J_CATCH_BEGIN:
-			return "CATCH{  ";
-		case J_CATCH_END:
-			return "}CATCH  ";
-		case J_FINALLY:
-			return "FINALLY ";
-		case J_IF_BEGIN:
-			return "IF{     ";
-		case J_ELSE:
-			return "ELSE    ";
-		case J_IF_END:
-			return "}IF     ";
-		case J_COND:
-			return "COND    ";
-		case J_BREAK:
-			return "BREAK   ";
-		case J_CONTINUE:
-			return "CONTINUE";
-		case J_RETURN:
-			return "RETURN  ";
-		case J_THROW:
-			return "THROW   ";
-		case J_IN_CLASS_BEGIN:
-			return "INCLASS{";
-		case J_IN_CLASS_END:
-			return "}INCLASS";
-		case J_APPLY:
-			return "APPLY   ";
-		case J_NEWCLASS:
-			return "NEWCLASS";
-		case J_NEWARRAY:
-			return "NEWARRAY";
-		case J_ASSIGN:
-			return "ASSIGN  ";
-		case J_INTERFACE_BEGIN:
-			return "INTERF{ ";
-		case J_INTERFACE_END:
-			return "}INTERF ";
-		case J_CONSTR_BEGIN:
-			return "CONSTR{ ";
-		case J_CONSTR_END:
-			return "}CONSTR ";
-		case J_INIT_BEGIN:
-			return "INIT{   ";
-		case J_INIT_END:
-			return "}INIT   ";
-		case J_VOID:
-			return "VOID    ";
-		case J_ARRAY_INIT_BEGIN:
-			return "ARRINIT{";
-		case J_ARRAY_INIT_END:
-			return "ARRINIT}";
-		case J_ENUM_BEGIN:
-			return "ENUM{   ";
-		case J_ENUM_CLASS_BEGIN:
-			return "ENUM_CLA";
-		case J_ENUM_END:
-			return "}ENUM   ";
-		case J_GENERIC:
-			return "GENERIC ";
-		case J_ASSERT:
-			return "ASSERT  ";
-		case J_ANNO:
-			return "ANNO    ";
-		case J_ANNO_MARKER:
-			return "ANNOMARK";
-		case J_ANNO_M_BEGIN:
-			return "ANNO_M{ ";
-		case J_ANNO_M_END:
-			return "}ANNO_M ";
-		case J_ANNO_T_BEGIN:
-			return "ANNO_T{ ";
-		case J_ANNO_T_END:
-			return "}ANNO_T ";
-		case J_ANNO_C_BEGIN:
-			return "ANNO_C{ ";
-		case J_ANNO_C_END:
-			return "}ANNO_C ";
-
-		case J_TRY_WITH_RESOURCE:
-			return "TRY_RES ";
-
-		default:
-			System.err.println("*UNKNOWN: " + type);
-			return "*UNKNOWN" + type;
-		}
-	}
-}

+ 0 - 78
jplag.frontend.java-1.7/src/main/java/de/jplag/java17/JavaTokenConstants.java

@@ -1,78 +0,0 @@
-package de.jplag.java17;
-
-import de.jplag.TokenConstants;
-
-public interface JavaTokenConstants extends TokenConstants {
-	final static int FILE_END = 0;
-
-	// Used to optionally separate methods from each other
-	// with an always marked token (for 1.5 grammar)
-	final static int SEPARATOR_TOKEN = 1;// @formatter:off
-
-	final static int J_PACKAGE = 2;				//  a // at the end of the constant means that there is a test case covering the token
-	final static int J_IMPORT = 3;				//
-	final static int J_CLASS_BEGIN = 4;			//
-	final static int J_CLASS_END = 5;			//
-	final static int J_METHOD_BEGIN = 6;		//
-	final static int J_METHOD_END = 7;			//
-	final static int J_VARDEF = 8;				//
-	final static int J_SYNC_BEGIN = 9;			//
-	final static int J_SYNC_END = 10;			//
-	final static int J_DO_BEGIN = 11;			//
-	final static int J_DO_END = 12;				//
-	final static int J_WHILE_BEGIN = 13;		//
-	final static int J_WHILE_END = 14;			//		
-	final static int J_FOR_BEGIN = 15;			//
-	final static int J_FOR_END = 16;			//
-	final static int J_SWITCH_BEGIN = 17;		//
-	final static int J_SWITCH_END = 18;			//
-	final static int J_CASE = 19;				//
-	final static int J_TRY_BEGIN = 20;			//
-	final static int J_CATCH_BEGIN = 21;    	//
-	final static int J_CATCH_END = 22;      	//
-	final static int J_FINALLY = 23;			//
-	final static int J_IF_BEGIN = 24;			//
-	final static int J_ELSE = 25;				//
-	final static int J_IF_END = 26;				//
-	final static int J_COND = 27;				//
-	final static int J_BREAK = 28;				//
-	final static int J_CONTINUE = 29;			//
-	final static int J_RETURN = 30;				//
-	final static int J_THROW = 31;				//
-	final static int J_IN_CLASS_BEGIN = 32;		//
-	final static int J_IN_CLASS_END = 33;		//
-	final static int J_APPLY = 34;				//
-	final static int J_NEWCLASS = 35;			//
-	final static int J_NEWARRAY = 36;			//
-	final static int J_ASSIGN = 37;				//
-	final static int J_INTERFACE_BEGIN = 38;	//
-	final static int J_INTERFACE_END = 39;		//
-	final static int J_CONSTR_BEGIN = 40;		//
-	final static int J_CONSTR_END = 41;			//
-	final static int J_INIT_BEGIN = 42;			//
-	final static int J_INIT_END = 43;			//
-	final static int J_VOID = 44;				//
-	final static int J_ARRAY_INIT_BEGIN = 45;	//
-	final static int J_ARRAY_INIT_END = 46; 	//
-
-	// new in 1.5:
-	final static int J_ENUM_BEGIN = 47;			//
-	final static int J_ENUM_CLASS_BEGIN = 48;	//
-	final static int J_ENUM_END = 49;			//
-	final static int J_GENERIC = 50;			//
-	final static int J_ASSERT = 51;				//
-
-	final static int J_ANNO = 52;				//
-	final static int J_ANNO_MARKER = 53;		//
-	final static int J_ANNO_M_BEGIN = 54;		//
-	final static int J_ANNO_M_END = 55;			//
-	final static int J_ANNO_T_BEGIN = 56;		//
-	final static int J_ANNO_T_END = 57;			//
-	final static int J_ANNO_C_BEGIN = 58;		//
-	final static int J_ANNO_C_END = 59;			//
-
-	// new in 1.7
-	final static int J_TRY_WITH_RESOURCE = 60; 	//
-
-	final static int NUM_DIFF_TOKENS = 61;		// @formatter:on
-}

+ 0 - 1462
jplag.frontend.java-1.7/src/main/java/de/jplag/java17/JplagJava7Listener.java

@@ -1,1462 +0,0 @@
-package de.jplag.java17;
-
-import org.antlr.v4.runtime.ParserRuleContext;
-import org.antlr.v4.runtime.tree.ErrorNode;
-import org.antlr.v4.runtime.tree.ParseTree;
-import org.antlr.v4.runtime.tree.TerminalNode;
-
-import de.jplag.java17.grammar.Java7Listener;
-import de.jplag.java17.grammar.Java7Parser.*;
-
-public class JplagJava7Listener implements Java7Listener, JavaTokenConstants {
-
-	private Parser jplagParser;
-
-	public JplagJava7Listener(Parser jplag) {
-		jplagParser = jplag;
-	}
-
-	@Override
-	public void enterEveryRule(ParserRuleContext arg0) {
-
-	}
-
-	@Override
-	public void exitEveryRule(ParserRuleContext arg0) {
-
-	}
-
-	@Override
-	public void visitErrorNode(ErrorNode arg0) {
-
-	}
-
-	@Override
-	public void visitTerminal(TerminalNode arg0) {
-		if (arg0.getText().equals("else")) {
-			jplagParser.add(J_ELSE, arg0.getSymbol());
-		}
-
-	}
-
-	@Override
-	public void enterInnerCreator(InnerCreatorContext ctx) {
-
-	}
-
-	@Override
-	public void exitInnerCreator(InnerCreatorContext ctx) {
-
-	}
-
-	@Override
-	public void enterAnnotationTypeDeclaration(AnnotationTypeDeclarationContext ctx) {
-		jplagParser.add(J_ANNO_T_BEGIN, ctx.getStart());
-	}
-
-	@Override
-	public void exitAnnotationTypeDeclaration(AnnotationTypeDeclarationContext ctx) {
-		jplagParser.add(J_ANNO_T_END, ctx.getStop());
-	}
-
-	@Override
-	public void enterVariableDeclarator(VariableDeclaratorContext ctx) {
-		jplagParser.add(J_VARDEF, ctx.getStart());
-	}
-
-	@Override
-	public void exitVariableDeclarator(VariableDeclaratorContext ctx) {
-
-	}
-
-	@Override
-	public void enterResources(ResourcesContext ctx) {
-
-	}
-
-	@Override
-	public void exitResources(ResourcesContext ctx) {
-
-	}
-
-	@Override
-	public void enterExpressionList(ExpressionListContext ctx) {
-
-	}
-
-	@Override
-	public void exitExpressionList(ExpressionListContext ctx) {
-
-	}
-
-	@Override
-	public void enterQualifiedIdentifier(QualifiedIdentifierContext ctx) {
-
-	}
-
-	@Override
-	public void exitQualifiedIdentifier(QualifiedIdentifierContext ctx) {
-
-	}
-
-	@Override
-	public void enterTypeDeclaration(TypeDeclarationContext ctx) {
-
-	}
-
-	@Override
-	public void exitTypeDeclaration(TypeDeclarationContext ctx) {
-
-	}
-
-	@Override
-	public void enterForUpdate(ForUpdateContext ctx) {
-
-	}
-
-	@Override
-	public void exitForUpdate(ForUpdateContext ctx) {
-
-	}
-
-	@Override
-	public void enterFormalParameterVariables(FormalParameterVariablesContext ctx) {
-
-	}
-
-	@Override
-	public void exitFormalParameterVariables(FormalParameterVariablesContext ctx) {
-
-	}
-
-	@Override
-	public void enterElementValueArrayInitializer(ElementValueArrayInitializerContext ctx) {
-
-	}
-
-	@Override
-	public void exitElementValueArrayInitializer(ElementValueArrayInitializerContext ctx) {
-
-	}
-
-	@Override
-	public void enterAnnotation(AnnotationContext ctx) {
-		jplagParser.add(J_ANNO, ctx.getStart());
-	}
-
-	@Override
-	public void exitAnnotation(AnnotationContext ctx) {
-
-	}
-
-	@Override
-	public void enterMemberDecl(MemberDeclContext ctx) {
-
-	}
-
-	@Override
-	public void exitMemberDecl(MemberDeclContext ctx) {
-
-	}
-
-	@Override
-	public void enterEnumConstant(EnumConstantContext ctx) {
-
-	}
-
-	@Override
-	public void exitEnumConstant(EnumConstantContext ctx) {
-
-	}
-
-	@Override
-	public void enterAnnotationName(AnnotationNameContext ctx) {
-
-	}
-
-	@Override
-	public void exitAnnotationName(AnnotationNameContext ctx) {
-
-	}
-
-	@Override
-	public void enterEnhancedForControl(EnhancedForControlContext ctx) {
-
-	}
-
-	@Override
-	public void exitEnhancedForControl(EnhancedForControlContext ctx) {
-
-	}
-
-	@Override
-	public void enterPrimary(PrimaryContext ctx) {
-
-	}
-
-	@Override
-	public void exitPrimary(PrimaryContext ctx) {
-
-	}
-
-	@Override
-	public void enterNormalClassDeclaration(NormalClassDeclarationContext ctx) {
-		jplagParser.add(J_CLASS_BEGIN, ctx.getStart());
-	}
-
-	@Override
-	public void exitNormalClassDeclaration(NormalClassDeclarationContext ctx) {
-		jplagParser.add(J_CLASS_END, ctx.getStop());
-
-	}
-
-	@Override
-	public void enterClassBody(ClassBodyContext ctx) {
-
-	}
-
-	@Override
-	public void exitClassBody(ClassBodyContext ctx) {
-
-	}
-
-	@Override
-	public void enterDefaultValue(DefaultValueContext ctx) {
-
-	}
-
-	@Override
-	public void exitDefaultValue(DefaultValueContext ctx) {
-
-	}
-
-	@Override
-	public void enterImportDeclaration(ImportDeclarationContext ctx) {
-		jplagParser.add(J_IMPORT, ctx.getStart());
-	}
-
-	@Override
-	public void exitImportDeclaration(ImportDeclarationContext ctx) {
-
-	}
-
-	@Override
-	public void enterVariableModifier(VariableModifierContext ctx) {
-
-	}
-
-	@Override
-	public void exitVariableModifier(VariableModifierContext ctx) {
-
-	}
-
-	@Override
-	public void enterEnumConstantName(EnumConstantNameContext ctx) {
-
-	}
-
-	@Override
-	public void exitEnumConstantName(EnumConstantNameContext ctx) {
-
-	}
-
-	@Override
-	public void enterCreatedName(CreatedNameContext ctx) {
-	}
-
-	@Override
-	public void exitCreatedName(CreatedNameContext ctx) {
-
-	}
-
-	@Override
-	public void enterInterfaceDeclaration(InterfaceDeclarationContext ctx) {
-	}
-
-	@Override
-	public void exitInterfaceDeclaration(InterfaceDeclarationContext ctx) {
-	}
-
-	@Override
-	public void enterQualifiedIdentifierList(QualifiedIdentifierListContext ctx) {
-
-	}
-
-	@Override
-	public void exitQualifiedIdentifierList(QualifiedIdentifierListContext ctx) {
-
-	}
-
-	@Override
-	public void enterPackageDeclaration(PackageDeclarationContext ctx) {
-		if (!ctx.annotation().isEmpty()) {
-			// if we have an annoation, we have an package-info.java and suppress the package token
-		} else {
-			jplagParser.add(J_PACKAGE, ctx.getStart());
-		}
-	}
-
-	@Override
-	public void exitPackageDeclaration(PackageDeclarationContext ctx) {
-	}
-
-	@Override
-	public void enterTypeRef(TypeRefContext ctx) {
-
-	}
-
-	@Override
-	public void exitTypeRef(TypeRefContext ctx) {
-
-	}
-
-	@Override
-	public void enterConstantDeclarator(ConstantDeclaratorContext ctx) {
-		jplagParser.add(J_VARDEF, ctx.getStart());
-	}
-
-	@Override
-	public void exitConstantDeclarator(ConstantDeclaratorContext ctx) {
-
-	}
-
-	@Override
-	public void enterConstantDeclaratorRest(ConstantDeclaratorRestContext ctx) {
-
-	}
-
-	@Override
-	public void exitConstantDeclaratorRest(ConstantDeclaratorRestContext ctx) {
-
-	}
-
-	@Override
-	public void enterElementValuePairs(ElementValuePairsContext ctx) {
-
-	}
-
-	@Override
-	public void exitElementValuePairs(ElementValuePairsContext ctx) {
-
-	}
-
-	@Override
-	public void enterVariableDeclarators(VariableDeclaratorsContext ctx) {
-
-	}
-
-	@Override
-	public void exitVariableDeclarators(VariableDeclaratorsContext ctx) {
-
-	}
-
-	@Override
-	public void enterTypeArguments(TypeArgumentsContext ctx) {
-
-	}
-
-	@Override
-	public void exitTypeArguments(TypeArgumentsContext ctx) {
-
-	}
-
-	@Override
-	public void enterClassCreatorRest(ClassCreatorRestContext ctx) {
-		if (ctx.classBody() != null) {
-			jplagParser.add(J_IN_CLASS_BEGIN, ctx.getStart());
-		}
-	}
-
-	@Override
-	public void exitClassCreatorRest(ClassCreatorRestContext ctx) {
-		if (ctx.classBody() != null) {
-			jplagParser.add(J_IN_CLASS_END, ctx.getStop());
-		}
-	}
-
-	@Override
-	public void enterSwitchBlock(SwitchBlockContext ctx) {
-
-	}
-
-	@Override
-	public void exitSwitchBlock(SwitchBlockContext ctx) {
-
-	}
-
-	@Override
-	public void enterAnnotationMethod(AnnotationMethodContext ctx) {
-
-	}
-
-	@Override
-	public void exitAnnotationMethod(AnnotationMethodContext ctx) {
-
-	}
-
-	@Override
-	public void enterModifier(ModifierContext ctx) {
-
-	}
-
-	@Override
-	public void exitModifier(ModifierContext ctx) {
-
-	}
-
-	@Override
-	public void enterCatchClause(CatchClauseContext ctx) {
-		jplagParser.add(J_CATCH_BEGIN, ctx.getStart());
-	}
-
-	@Override
-	public void exitCatchClause(CatchClauseContext ctx) {
-		jplagParser.add(J_CATCH_END, ctx.getStop());
-	}
-
-
-	@Override
-	public void enterEnumConstants(EnumConstantsContext ctx) {
-		jplagParser.add(J_ENUM_CLASS_BEGIN, ctx.getStop());
-	}
-
-	@Override
-	public void exitEnumConstants(EnumConstantsContext ctx) {
-
-	}
-
-	@Override
-	public void enterInterfaceBody(InterfaceBodyContext ctx) {
-
-	}
-
-	@Override
-	public void exitInterfaceBody(InterfaceBodyContext ctx) {
-
-	}
-
-	@Override
-	public void enterConstantExpression(ConstantExpressionContext ctx) {
-
-	}
-
-	@Override
-	public void exitConstantExpression(ConstantExpressionContext ctx) {
-
-	}
-
-	@Override
-	public void enterPackageOrTypeName(PackageOrTypeNameContext ctx) {
-	}
-
-	@Override
-	public void exitPackageOrTypeName(PackageOrTypeNameContext ctx) {
-	}
-
-	@Override
-	public void enterForControl(ForControlContext ctx) {
-	}
-
-	@Override
-	public void exitForControl(ForControlContext ctx) {
-	}
-
-	@Override
-	public void enterEnumDeclaration(EnumDeclarationContext ctx) {
-		jplagParser.add(J_ENUM_BEGIN, ctx.getStart());
-	}
-
-	@Override
-	public void exitEnumDeclaration(EnumDeclarationContext ctx) {
-		jplagParser.add(J_ENUM_END, ctx.getStop());
-	}
-
-	@Override
-	public void enterLocalVariableDeclaration(LocalVariableDeclarationContext ctx) {
-	}
-
-	@Override
-	public void exitLocalVariableDeclaration(LocalVariableDeclarationContext ctx) {
-	}
-
-	@Override
-	public void enterTypeList(TypeListContext ctx) {
-	}
-
-	@Override
-	public void exitTypeList(TypeListContext ctx) {
-
-	}
-
-	@Override
-	public void enterTypeParameter(TypeParameterContext ctx) {
-
-	}
-
-	@Override
-	public void exitTypeParameter(TypeParameterContext ctx) {
-
-	}
-
-	@Override
-	public void enterVariableDeclaratorId(VariableDeclaratorIdContext ctx) {
-
-	}
-
-	@Override
-	public void exitVariableDeclaratorId(VariableDeclaratorIdContext ctx) {
-
-	}
-
-	@Override
-	public void enterExplicitConstructorInvocation(ExplicitConstructorInvocationContext ctx) {
-		jplagParser.add(J_APPLY, ctx.start);
-	}
-
-	@Override
-	public void exitExplicitConstructorInvocation(ExplicitConstructorInvocationContext ctx) {
-
-	}
-
-	@Override
-	public void enterInterfaceMethodDeclaratorRest(InterfaceMethodDeclaratorRestContext ctx) {
-
-	}
-
-	@Override
-	public void exitInterfaceMethodDeclaratorRest(InterfaceMethodDeclaratorRestContext ctx) {
-
-	}
-
-	@Override
-	public void enterElementValue(ElementValueContext ctx) {
-
-	}
-
-	@Override
-	public void exitElementValue(ElementValueContext ctx) {
-
-	}
-
-	@Override
-	public void enterCompilationUnit(CompilationUnitContext ctx) {
-
-	}
-
-	@Override
-	public void exitCompilationUnit(CompilationUnitContext ctx) {
-
-	}
-
-	@Override
-	public void enterStatementExpression(StatementExpressionContext ctx) {
-
-	}
-
-	@Override
-	public void exitStatementExpression(StatementExpressionContext ctx) {
-
-	}
-
-	@Override
-	public void enterClassOrInterfaceType(ClassOrInterfaceTypeContext ctx) {
-
-	}
-
-	@Override
-	public void exitClassOrInterfaceType(ClassOrInterfaceTypeContext ctx) {
-
-	}
-
-	@Override
-	public void enterFormalParameterDeclarations(FormalParameterDeclarationsContext ctx) {
-
-	}
-
-	@Override
-	public void exitFormalParameterDeclarations(FormalParameterDeclarationsContext ctx) {
-
-	}
-
-	@Override
-	public void enterBlock(BlockContext ctx) {
-
-	}
-
-	@Override
-	public void exitBlock(BlockContext ctx) {
-
-	}
-
-	@Override
-	public void enterVariableInitializer(VariableInitializerContext ctx) {
-		if (ctx.parent instanceof ArrayInitializerContext) {
-			// dont print assignment, as this is part of an array initialization
-		} else {
-			jplagParser.add(J_ASSIGN, ctx.getStart());
-		}
-	}
-
-	@Override
-	public void exitVariableInitializer(VariableInitializerContext ctx) {
-
-	}
-
-	@Override
-	public void enterBlockStatement(BlockStatementContext ctx) {
-
-	}
-
-	@Override
-	public void exitBlockStatement(BlockStatementContext ctx) {
-
-	}
-
-	@Override
-	public void enterIntegerLiteral(IntegerLiteralContext ctx) {
-
-	}
-
-	@Override
-	public void exitIntegerLiteral(IntegerLiteralContext ctx) {
-
-	}
-
-	@Override
-	public void enterInterfaceMemberDecl(InterfaceMemberDeclContext ctx) {
-
-	}
-
-	@Override
-	public void exitInterfaceMemberDecl(InterfaceMemberDeclContext ctx) {
-
-	}
-
-	@Override
-	public void enterCreator(CreatorContext ctx) {
-		if (ctx.classCreatorRest() != null) {
-			if (// @formatter:off
-				// "normal" generic
-				ctx.createdName().typeArguments().size() > 0 
-				// allow diamond operator 
-				|| ctx.createdName().children.size() > 1 && (ctx.createdName().getChild(1).getText().equals("<") && ctx.createdName().getChild(2).getText().equals(">"))
-				|| ctx.createdName().children.size() > 3 && (ctx.createdName().getChild(3).getText().equals("<") && ctx.createdName().getChild(4).getText().equals(">"))) {
-			    // @formatter: on
-				jplagParser.add(J_GENERIC, ctx.start);
-			}
-			jplagParser.add(J_NEWCLASS, ctx.start);
-		} else if (ctx.arrayCreatorRest() != null) {
-			jplagParser.add(J_NEWARRAY, ctx.start);
-
-		}
-
-	}
-
-	@Override
-	public void exitCreator(CreatorContext ctx) {
-
-	}
-
-	@Override
-	public void enterConstantDeclaratorsRest(ConstantDeclaratorsRestContext ctx) {
-
-	}
-
-	@Override
-	public void exitConstantDeclaratorsRest(ConstantDeclaratorsRestContext ctx) {
-
-	}
-
-	@Override
-	public void enterInterfaceGenericMethodDecl(InterfaceGenericMethodDeclContext ctx) {
-
-	}
-
-	@Override
-	public void exitInterfaceGenericMethodDecl(InterfaceGenericMethodDeclContext ctx) {
-
-	}
-
-	@Override
-	public void enterInterfaceMethodOrFieldDecl(InterfaceMethodOrFieldDeclContext ctx) {
-
-	}
-
-	@Override
-	public void exitInterfaceMethodOrFieldDecl(InterfaceMethodOrFieldDeclContext ctx) {
-
-	}
-
-	@Override
-	public void enterTryStatement(TryStatementContext ctx) {
-		jplagParser.add(J_TRY_BEGIN, ctx.getStart());
-	}
-
-	@Override
-	public void exitTryStatement(TryStatementContext ctx) {
-		if (hasFinally(ctx)) {
-			jplagParser.add(J_FINALLY, ctx.start);
-		}
-	}
-
-	private boolean hasFinally(TryStatementContext ctx) {
-		for (ParseTree pt : ctx.children) {
-			if (pt instanceof TerminalNode) {
-				if (((TerminalNode) pt).getText().equals("finally")) {
-					return true;
-				}
-			}
-		}
-		
-		return false;
-	}
-
-	@Override
-	public void enterFieldDeclaration(FieldDeclarationContext ctx) {
-
-	}
-
-	@Override
-	public void exitFieldDeclaration(FieldDeclarationContext ctx) {
-
-	}
-
-	@Override
-	public void enterNormalInterfaceDeclaration(NormalInterfaceDeclarationContext ctx) {
-		jplagParser.add(J_INTERFACE_BEGIN, ctx.start);
-	}
-
-	@Override
-	public void exitNormalInterfaceDeclaration(NormalInterfaceDeclarationContext ctx) {
-		jplagParser.add(J_INTERFACE_END, ctx.start);
-	}
-
-	@Override
-	public void enterExplicitGenericInvocation(ExplicitGenericInvocationContext ctx) {
-		jplagParser.add(J_APPLY, ctx.start);
-	}
-
-	@Override
-	public void exitExplicitGenericInvocation(ExplicitGenericInvocationContext ctx) {
-
-	}
-
-	@Override
-	public void enterMethodDeclaration(MethodDeclarationContext ctx) {
-		if (ctx.start.getText().equals("void")) {
-			jplagParser.add(J_VOID, ctx.start);
-		}
-		jplagParser.add(J_METHOD_BEGIN, ctx.start);
-	}
-
-	@Override
-	public void exitMethodDeclaration(MethodDeclarationContext ctx) {
-		jplagParser.add(J_METHOD_END, ctx.getStop());
-	}
-
-	@Override
-	public void enterParExpression(ParExpressionContext ctx) {
-
-	}
-
-	@Override
-	public void exitParExpression(ParExpressionContext ctx) {
-
-	}
-
-	@Override
-	public void enterSwitchLabel(SwitchLabelContext ctx) {
-
-	}
-
-	@Override
-	public void exitSwitchLabel(SwitchLabelContext ctx) {
-		jplagParser.add(J_CASE, ctx.getStop());
-	}
-
-	@Override
-	public void enterConstructorDeclaration(ConstructorDeclarationContext ctx) {
-		jplagParser.add(J_CONSTR_BEGIN, ctx.getStart());
-	}
-
-	@Override
-	public void exitConstructorDeclaration(ConstructorDeclarationContext ctx) {
-		jplagParser.add(J_CONSTR_END, ctx.getStop());
-	}
-
-	@Override
-	public void enterTypeParameters(TypeParametersContext ctx) {
-
-	}
-
-	@Override
-	public void exitTypeParameters(TypeParametersContext ctx) {
-
-	}
-
-	@Override
-	public void enterAnnotationTypeElement(AnnotationTypeElementContext ctx) {
-
-	}
-
-	@Override
-	public void exitAnnotationTypeElement(AnnotationTypeElementContext ctx) {
-
-	}
-
-	@Override
-	public void enterResource(ResourceContext ctx) {
-		jplagParser.add(J_TRY_WITH_RESOURCE, ctx.getStart());
-	}
-
-	@Override
-	public void exitResource(ResourceContext ctx) {
-
-	}
-
-	@Override
-	public void enterClassDeclaration(ClassDeclarationContext ctx) {
-	}
-
-	@Override
-	public void exitClassDeclaration(ClassDeclarationContext ctx) {
-	}
-
-	@Override
-	public void enterElementValuePair(ElementValuePairContext ctx) {
-
-	}
-
-	@Override
-	public void exitElementValuePair(ElementValuePairContext ctx) {
-
-	}
-
-	@Override
-	public void enterBooleanLiteral(BooleanLiteralContext ctx) {
-
-	}
-
-	@Override
-	public void exitBooleanLiteral(BooleanLiteralContext ctx) {
-
-	}
-
-	@Override
-	public void enterVoidInterfaceMethodDeclaratorRest(VoidInterfaceMethodDeclaratorRestContext ctx) {
-
-	}
-
-	@Override
-	public void exitVoidInterfaceMethodDeclaratorRest(VoidInterfaceMethodDeclaratorRestContext ctx) {
-
-	}
-
-	@Override
-	public void enterInterfaceMethodOrFieldRest(InterfaceMethodOrFieldRestContext ctx) {
-
-	}
-
-	@Override
-	public void exitInterfaceMethodOrFieldRest(InterfaceMethodOrFieldRestContext ctx) {
-
-	}
-
-	@Override
-	public void enterTypeName(TypeNameContext ctx) {
-
-	}
-
-	@Override
-	public void exitTypeName(TypeNameContext ctx) {
-
-	}
-
-	@Override
-	public void enterArguments(ArgumentsContext ctx) {
-	}
-
-	@Override
-	public void exitArguments(ArgumentsContext ctx) {
-
-	}
-
-	@Override
-	public void enterMethodBody(MethodBodyContext ctx) {
-
-	}
-
-	@Override
-	public void exitMethodBody(MethodBodyContext ctx) {
-
-	}
-
-	@Override
-	public void enterArrayInitializer(ArrayInitializerContext ctx) {
-		jplagParser.add(J_ARRAY_INIT_BEGIN, ctx.getStart());
-	}
-
-	@Override
-	public void exitArrayInitializer(ArrayInitializerContext ctx) {
-		jplagParser.add(J_ARRAY_INIT_END, ctx.getStop());
-	}
-
-	@Override
-	public void enterFormalParameters(FormalParametersContext ctx) {
-
-	}
-
-	@Override
-	public void exitFormalParameters(FormalParametersContext ctx) {
-
-	}
-
-	@Override
-	public void enterPrimitiveType(PrimitiveTypeContext ctx) {
-
-	}
-
-	@Override
-	public void exitPrimitiveType(PrimitiveTypeContext ctx) {
-
-	}
-
-	@Override
-	public void enterNonWildcardTypeArguments(NonWildcardTypeArgumentsContext ctx) {
-
-	}
-
-	@Override
-	public void exitNonWildcardTypeArguments(NonWildcardTypeArgumentsContext ctx) {
-
-	}
-
-	@Override
-	public void enterTypeArgument(TypeArgumentContext ctx) {
-		if ( ctx.parent.parent instanceof CreatedNameContext) {	
-			// the generic token has already been emitted by the class emitter
-		} else {
-			jplagParser.add(J_GENERIC, ctx.getStart());
-		}
-	}
-
-	@Override
-	public void exitTypeArgument(TypeArgumentContext ctx) {
-
-	}
-
-	@Override
-	public void enterClassOrInterfaceDeclaration(ClassOrInterfaceDeclarationContext ctx) {
-
-	}
-
-	@Override
-	public void exitClassOrInterfaceDeclaration(ClassOrInterfaceDeclarationContext ctx) {
-
-	}
-
-	@Override
-	public void enterForInit(ForInitContext ctx) {
-
-	}
-
-	@Override
-	public void exitForInit(ForInitContext ctx) {
-
-	}
-
-	@Override
-	public void enterArrayCreatorRest(ArrayCreatorRestContext ctx) {
-
-	}
-
-	@Override
-	public void exitArrayCreatorRest(ArrayCreatorRestContext ctx) {
-
-	}
-
-	@Override
-	public void enterBound(BoundContext ctx) {
-
-	}
-
-	@Override
-	public void exitBound(BoundContext ctx) {
-
-	}
-
-	@Override
-	public void enterSwitchBlockStatementGroup(SwitchBlockStatementGroupContext ctx) {
-
-	}
-
-	@Override
-	public void exitSwitchBlockStatementGroup(SwitchBlockStatementGroupContext ctx) {
-
-	}
-
-	@Override
-	public void enterLiteral(LiteralContext ctx) {
-
-	}
-
-	@Override
-	public void exitLiteral(LiteralContext ctx) {
-
-	}
-
-	@Override
-	public void enterDoWhileStmt(DoWhileStmtContext ctx) {
-		jplagParser.add(J_DO_BEGIN, ctx.getStart());
-	}
-
-	@Override
-	public void exitDoWhileStmt(DoWhileStmtContext ctx) {
-		jplagParser.add(J_DO_END, ctx.getStop());
-	}
-
-	@Override
-	public void enterBreak(BreakContext ctx) {
-		jplagParser.add(J_BREAK, ctx.getStart());
-	}
-
-	@Override
-	public void exitBreak(BreakContext ctx) {
-
-	}
-
-	@Override
-	public void enterIfStmt(IfStmtContext ctx) {
-		jplagParser.add(J_IF_BEGIN, ctx.getStart());
-	}
-
-	@Override
-	public void exitIfStmt(IfStmtContext ctx) {
-		jplagParser.add(J_IF_END, ctx.getStop());
-	}
-
-	@Override
-	public void enterThrowStmt(ThrowStmtContext ctx) {
-		jplagParser.add(J_THROW, ctx.getStart());
-	}
-
-	@Override
-	public void exitThrowStmt(ThrowStmtContext ctx) {
-	}
-
-	@Override
-	public void enterSynchronizedStmt(SynchronizedStmtContext ctx) {
-		jplagParser.add(J_SYNC_BEGIN, ctx.getStart());
-	}
-
-	@Override
-	public void exitSynchronizedStmt(SynchronizedStmtContext ctx) {
-		jplagParser.add(J_SYNC_END, ctx.getStop());
-	}
-
-	@Override
-	public void enterStatementExpressStmt(StatementExpressStmtContext ctx) {
-	}
-
-	@Override
-	public void exitStatementExpressStmt(StatementExpressStmtContext ctx) {
-
-	}
-
-	@Override
-	public void enterBlockStmt(BlockStmtContext ctx) {
-
-	}
-
-	@Override
-	public void exitBlockStmt(BlockStmtContext ctx) {
-
-	}
-
-	@Override
-	public void enterReturnStmt(ReturnStmtContext ctx) {
-		jplagParser.add(J_RETURN, ctx.getStart());
-	}
-
-	@Override
-	public void exitReturnStmt(ReturnStmtContext ctx) {
-
-	}
-
-	@Override
-	public void enterSemicStmt(SemicStmtContext ctx) {
-
-	}
-
-	@Override
-	public void exitSemicStmt(SemicStmtContext ctx) {
-
-	}
-
-	@Override
-	public void enterIdentifiedStmt(IdentifiedStmtContext ctx) {
-
-	}
-
-	@Override
-	public void exitIdentifiedStmt(IdentifiedStmtContext ctx) {
-
-	}
-
-	@Override
-	public void enterTryStmt(TryStmtContext ctx) {
-		// nothing happens here see enterTryStatement
-	}
-
-	@Override
-	public void exitTryStmt(TryStmtContext ctx) {
-		// nothing happens here see exitTryStatement
-	}
-
-	@Override
-	public void enterContinueStmt(ContinueStmtContext ctx) {
-		jplagParser.add(J_CONTINUE, ctx.getStart());
-	}
-
-	@Override
-	public void exitContinueStmt(ContinueStmtContext ctx) {
-	}
-
-	@Override
-	public void enterAssertStmt(AssertStmtContext ctx) {
-		jplagParser.add(J_ASSERT, ctx.getStart());
-	}
-
-	@Override
-	public void exitAssertStmt(AssertStmtContext ctx) {
-	}
-
-	@Override
-	public void enterSwitchStmt(SwitchStmtContext ctx) {
-		jplagParser.add(J_SWITCH_BEGIN, ctx.getStart());
-	}
-
-	@Override
-	public void exitSwitchStmt(SwitchStmtContext ctx) {
-		jplagParser.add(J_SWITCH_END, ctx.getStop());
-	}
-
-	@Override
-	public void enterForStmt(ForStmtContext ctx) {
-		jplagParser.add(J_FOR_BEGIN, ctx.getStart());
-	}
-
-	@Override
-	public void exitForStmt(ForStmtContext ctx) {
-		jplagParser.add(J_FOR_END, ctx.getStop());
-	}
-
-	@Override
-	public void enterWhileStmt(WhileStmtContext ctx) {
-		jplagParser.add(J_WHILE_BEGIN, ctx.getStart());
-	}
-
-	@Override
-	public void exitWhileStmt(WhileStmtContext ctx) {
-		jplagParser.add(J_WHILE_END, ctx.getStop());
-	}
-
-	@Override
-	public void enterExprBinaryOperatorInstanceof(ExprBinaryOperatorInstanceofContext ctx) {
-
-	}
-
-	@Override
-	public void exitExprBinaryOperatorInstanceof(ExprBinaryOperatorInstanceofContext ctx) {
-
-	}
-
-	@Override
-	public void enterExprBinaryOperatorGT(ExprBinaryOperatorGTContext ctx) {
-
-	}
-
-	@Override
-	public void exitExprBinaryOperatorGT(ExprBinaryOperatorGTContext ctx) {
-
-	}
-
-	@Override
-	public void enterExprNotExpression(ExprNotExpressionContext ctx) {
-
-	}
-
-	@Override
-	public void exitExprNotExpression(ExprNotExpressionContext ctx) {
-
-	}
-
-	@Override
-	public void enterExprNewCreator(ExprNewCreatorContext ctx) {
-
-	}
-
-	@Override
-	public void exitExprNewCreator(ExprNewCreatorContext ctx) {
-
-	}
-
-	@Override
-	public void enterExprBinaryOperatorAdd(ExprBinaryOperatorAddContext ctx) {
-
-	}
-
-	@Override
-	public void exitExprBinaryOperatorAdd(ExprBinaryOperatorAddContext ctx) {
-
-	}
-
-	@Override
-	public void enterExprBinaryOperatorMult(ExprBinaryOperatorMultContext ctx) {
-
-	}
-
-	@Override
-	public void exitExprBinaryOperatorMult(ExprBinaryOperatorMultContext ctx) {
-
-	}
-
-	@Override
-	public void enterExprPrimary(ExprPrimaryContext ctx) {
-
-	}
-
-	@Override
-	public void exitExprPrimary(ExprPrimaryContext ctx) {
-
-	}
-
-	@Override
-	public void enterExprExplicitGenericInvocation(ExprExplicitGenericInvocationContext ctx) {
-
-	}
-
-	@Override
-	public void exitExprExplicitGenericInvocation(ExprExplicitGenericInvocationContext ctx) {
-
-	}
-
-	@Override
-	public void enterExprSuperIdentifier(ExprSuperIdentifierContext ctx) {
-
-	}
-
-	@Override
-	public void exitExprSuperIdentifier(ExprSuperIdentifierContext ctx) {
-
-	}
-
-	@Override
-	public void enterExprSuper(ExprSuperContext ctx) {
-
-	}
-
-	@Override
-	public void exitExprSuper(ExprSuperContext ctx) {
-
-	}
-
-	@Override
-	public void enterExprThis(ExprThisContext ctx) {
-
-	}
-
-	@Override
-	public void exitExprThis(ExprThisContext ctx) {
-
-	}
-
-	@Override
-	public void enterExprBinaryBoolAnd(ExprBinaryBoolAndContext ctx) {
-
-	}
-
-	@Override
-	public void exitExprBinaryBoolAnd(ExprBinaryBoolAndContext ctx) {
-
-	}
-
-	@Override
-	public void enterExprBinaryAnd(ExprBinaryAndContext ctx) {
-
-	}
-
-	@Override
-	public void exitExprBinaryAnd(ExprBinaryAndContext ctx) {
-
-	}
-
-	@Override
-	public void enterExprIncDecExpression(ExprIncDecExpressionContext ctx) {
-
-	}
-
-	@Override
-	public void exitExprIncDecExpression(ExprIncDecExpressionContext ctx) {
-
-	}
-
-	@Override
-	public void enterExprBinaryBoolOr(ExprBinaryBoolOrContext ctx) {
-
-	}
-
-	@Override
-	public void exitExprBinaryBoolOr(ExprBinaryBoolOrContext ctx) {
-
-	}
-
-	@Override
-	public void enterExprBinaryEquals(ExprBinaryEqualsContext ctx) {
-
-	}
-
-	@Override
-	public void exitExprBinaryEquals(ExprBinaryEqualsContext ctx) {
-
-	}
-
-	@Override
-	public void enterExprAssignment(ExprAssignmentContext ctx) {
-		jplagParser.add(J_ASSIGN, ctx.getStart());
-	}
-
-	@Override
-	public void exitExprAssignment(ExprAssignmentContext ctx) {
-
-	}
-
-	@Override
-	public void enterExprBinaryNot(ExprBinaryNotContext ctx) {
-
-	}
-
-	@Override
-	public void exitExprBinaryNot(ExprBinaryNotContext ctx) {
-
-	}
-
-	@Override
-	public void enterExprNewIdentidier(ExprNewIdentidierContext ctx) {
-
-	}
-
-	@Override
-	public void exitExprNewIdentidier(ExprNewIdentidierContext ctx) {
-
-	}
-
-	@Override
-	public void enterExprMethodExpressionList(ExprMethodExpressionListContext ctx) {
-		jplagParser.add(J_APPLY, ctx.getStart());
-	}
-
-	@Override
-	public void exitExprMethodExpressionList(ExprMethodExpressionListContext ctx) {
-
-	}
-
-	@Override
-	public void enterExprCastExpression(ExprCastExpressionContext ctx) {
-
-	}
-
-	@Override
-	public void exitExprCastExpression(ExprCastExpressionContext ctx) {
-
-	}
-
-	@Override
-	public void enterExprBinaryOperatorComp(ExprBinaryOperatorCompContext ctx) {
-
-	}
-
-	@Override
-	public void exitExprBinaryOperatorComp(ExprBinaryOperatorCompContext ctx) {
-
-	}
-
-	@Override
-	public void enterExprBinaryOr(ExprBinaryOrContext ctx) {
-
-	}
-
-	@Override
-	public void exitExprBinaryOr(ExprBinaryOrContext ctx) {
-
-	}
-
-	@Override
-	public void enterExprExpressionIncDec(ExprExpressionIncDecContext ctx) {
-
-	}
-
-	@Override
-	public void exitExprExpressionIncDec(ExprExpressionIncDecContext ctx) {
-
-	}
-
-	@Override
-	public void enterExprArrayExpression(ExprArrayExpressionContext ctx) {
-
-	}
-
-	@Override
-	public void exitExprArrayExpression(ExprArrayExpressionContext ctx) {
-
-	}
-
-	@Override
-	public void enterExprIdentifier(ExprIdentifierContext ctx) {
-
-	}
-
-	@Override
-	public void exitExprIdentifier(ExprIdentifierContext ctx) {
-
-	}
-
-	@Override
-	public void enterCbdMember(CbdMemberContext ctx) {
-
-	}
-
-	@Override
-	public void exitCbdMember(CbdMemberContext ctx) {
-
-	}
-
-	@Override
-	public void enterCbdSemicolon(CbdSemicolonContext ctx) {
-
-	}
-
-	@Override
-	public void exitCbdSemicolon(CbdSemicolonContext ctx) {
-
-	}
-
-	@Override
-	public void enterCbdBlock(CbdBlockContext ctx) {
-		jplagParser.add(J_INIT_BEGIN, ctx.getStart());
-	}
-
-	@Override
-	public void exitCbdBlock(CbdBlockContext ctx) {
-		jplagParser.add(J_INIT_END, ctx.getStop());
-	}
-
-	@Override
-	public void enterExprConditionalExpression(ExprConditionalExpressionContext ctx) {
-		jplagParser.add(J_COND, ctx.getStart());
-	}
-
-	@Override
-	public void exitExprConditionalExpression(ExprConditionalExpressionContext ctx) {
-	}
-}

+ 0 - 76
jplag.frontend.java-1.7/src/main/java/de/jplag/java17/Language.java

@@ -1,76 +0,0 @@
-package de.jplag.java17;
-
-import java.io.File;
-
-import de.jplag.ErrorConsumer;
-import de.jplag.TokenList;
-
-public class Language implements de.jplag.Language {
-	private Parser parser;
-
-	public Language(ErrorConsumer program) {
-		this.parser = new Parser();
-		this.parser.setProgram(program);
-	}
-
-	@Override
-    public String[] suffixes() {
-		String[] res = { ".java", ".jav", ".JAVA", ".JAV" };
-		return res;
-	}
-
-	@Override
-    public int errorCount() {
-		return this.parser.errorsCount();
-	}
-
-	@Override
-    public String getName() {
-		return "Java1.7 AbstractParser";
-	}
-
-	@Override
-    public String getShortName() {
-		return "java17";
-	}
-
-	@Override
-    public int minimumTokenMatch() {
-		return 9;
-	}
-
-	@Override
-    public TokenList parse(File dir, String[] files) {
-		return this.parser.parse(dir, files);
-	}
-
-	@Override
-    public boolean hasErrors() {
-		return this.parser.hasErrors();
-	}
-
-	@Override
-    public boolean supportsColumns() {
-		return true;
-	}
-
-	@Override
-    public boolean isPreformatted() {
-		return true;
-	}
-
-	@Override
-    public boolean usesIndex() {
-		return false;
-	}
-
-	@Override
-    public int numberOfTokens() {
-		return JavaTokenConstants.NUM_DIFF_TOKENS;
-	}
-
-	@Override
-    public String type2string(int type) {
-		return JavaToken.type2string(type);
-	}
-}

+ 0 - 80
jplag.frontend.java-1.7/src/main/java/de/jplag/java17/Parser.java

@@ -1,80 +0,0 @@
-package de.jplag.java17;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-
-import org.antlr.v4.runtime.CharStream;
-import org.antlr.v4.runtime.CharStreams;
-import org.antlr.v4.runtime.CommonTokenStream;
-import org.antlr.v4.runtime.Token;
-import org.antlr.v4.runtime.tree.ParseTree;
-import org.antlr.v4.runtime.tree.ParseTreeWalker;
-
-import de.jplag.AbstractParser;
-import de.jplag.TokenList;
-import de.jplag.java17.grammar.Java7Lexer;
-import de.jplag.java17.grammar.Java7Parser;
-import de.jplag.java17.grammar.Java7Parser.CompilationUnitContext;
-
-public class Parser extends AbstractParser implements JavaTokenConstants {
-	private TokenList struct = new TokenList();
-	private String currentFile;
-
-	public TokenList parse(File dir, String files[]) {
-		struct = new TokenList();
-		errors = 0;
-		for (int i = 0; i < files.length; i++) {
-			getErrorConsumer().print(null, "Parsing file " + files[i]);
-			if (!parseFile(dir, files[i]))
-				errors++;
-			System.gc();//Emeric
-			struct.addToken(new JavaToken(FILE_END, files[i], -1, -1, -1));
-		}
-		this.parseEnd();
-		return struct;
-	}
-
-	public boolean parseFile(File dir, String file) {
-		BufferedInputStream fis;
-
-		CharStream input;
-		try {
-			fis = new BufferedInputStream(new FileInputStream(new File(dir, file)));
-			currentFile = file;
-			input = CharStreams.fromStream(fis);			        
-
-			// create a lexer that feeds off of input CharStream
-			Java7Lexer lexer = new Java7Lexer(input);
-
-			// create a buffer of tokens pulled from the lexer
-			CommonTokenStream tokens = new CommonTokenStream(lexer);
-
-			// create a parser that feeds off the tokens buffer
-			Java7Parser parser = new Java7Parser(tokens);
-			CompilationUnitContext cuc = parser.compilationUnit();
-
-			ParseTreeWalker ptw = new ParseTreeWalker();
-			for (int i = 0; i < cuc.getChildCount(); i++) {
-				ParseTree pt = cuc.getChild(i);
-				ptw.walk(new JplagJava7Listener(this), pt);
-			}
-
-		} catch (IOException e) {
-			getErrorConsumer().addError("Parsing Error in '" + file + "':\n" + e.getMessage());
-			return false;
-		}
-
-		return true;
-	}
-
-	//	public void addTerminal(int type, int line, int start, String text) {
-	//		struct.addToken(new JavaToken(type, (currentFile == null ? "null" : currentFile), line, start, text.length()));
-	//	}
-	
-	public void add(int type, Token tok) {
-		struct.addToken(new JavaToken(type, (currentFile == null ? "null" : currentFile), tok.getLine(), tok.getCharPositionInLine() + 1, 
-				tok.getText().length()));
-	}
-}

+ 0 - 22
jplag.frontend.java-1.7/src/test/java/de/jplag/StrippedProgram.java

@@ -1,22 +0,0 @@
-package de.jplag;
-
-/**
- * This is a stripped version of the JPlag main class ErrorConsumer to be used during front end development only.
- */
-public class StrippedProgram implements ErrorConsumer {
-    @Override
-    public void addError(String errorMsg) {
-        System.err.println(errorMsg);
-    }
-
-    @Override
-    public void print(String normalMsg, String longMsg) {
-        if (longMsg != null) {
-            System.out.println(longMsg);
-        } else if (normalMsg != null) {
-            System.out.println(normalMsg);
-        } else {
-            System.out.println("Somebody messed up - no message given");
-        }
-    }
-}

+ 0 - 80
jplag.frontend.java-1.7/src/test/java/de/jplag/antlr4Learning/Antlr4LearningTests.java

@@ -1,80 +0,0 @@
-package de.jplag.antlr4Learning;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-
-import org.antlr.v4.runtime.CharStream;
-import org.antlr.v4.runtime.CharStreams;
-import org.antlr.v4.runtime.CommonTokenStream;
-import org.antlr.v4.runtime.Token;
-import org.antlr.v4.runtime.tree.ParseTree;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import de.jplag.java17.JplagJava7Listener;
-import de.jplag.java17.grammar.Java7Lexer;
-import de.jplag.java17.grammar.Java7Parser;
-
-public class Antlr4LearningTests {
-	private static File srcTestResources;
-
-	@BeforeClass
-	public static void getPaths() {
-		srcTestResources = new File(System.getProperty("user.dir"), "src/test/resources");
-	}
-
-	@Test
-	public void testVisitor() throws IOException {
-		BufferedInputStream fis = new BufferedInputStream(new FileInputStream(new File(srcTestResources, "ExceptionOne.java")));
-		CharStream input = CharStreams.fromStream(fis);
-
-		// create a lexer that feeds off of input CharStream
-		Java7Lexer lexer = new Java7Lexer(input);
-
-		// create a buffer of tokens pulled from the lexer
-		CommonTokenStream tokens = new CommonTokenStream(lexer);
-
-		Java7Parser j7p = new Java7Parser(tokens);
-		j7p.addParseListener(new JplagJava7Listener(new de.jplag.java17.Parser()));
-
-		j7p.compilationUnit();
-	}
-
-	@Ignore
-	public void howToUseAntlr4() throws IOException {
-		FileInputStream fis = new FileInputStream(new File(srcTestResources, "Java7FeatureTest.java"));
-		// create a CharStream that reads from file input stream
-		CharStream input = CharStreams.fromStream(fis);
-
-		// create a lexer that feeds off of input CharStream
-		Java7Lexer lexer = new Java7Lexer(input);
-
-		// create a buffer of tokens pulled from the lexer
-		CommonTokenStream tokens = new CommonTokenStream(lexer);
-
-		// create a parser that feeds off the tokens buffer
-		Java7Parser parser = new Java7Parser(tokens);
-
-		ParseTree tree = parser.compilationUnit(); // begin parsing at compilationUnit rule
-		System.out.println(tree.toStringTree(parser)); // print LISP-style tree
-
-	}
-
-	@Ignore
-	public void howToUseAntlr4Tokens() throws IOException {
-		FileInputStream fis = new FileInputStream(new File(srcTestResources, "Java7FeatureTest.java"));
-		// create a CharStream that reads from file input stream
-		CharStream input = CharStreams.fromStream(fis);
-
-		// create a lexer that feeds off of input CharStream
-		Java7Lexer lexer = new Java7Lexer(input);
-
-		for (Token t : lexer.getAllTokens()) {
-			System.out.println(lexer.getTokenNames()[t.getType()]);
-		}
-	}
-
-}

+ 0 - 45
jplag.frontend.java-1.7/src/test/java/de/jplag/java17/Bug58.java

@@ -1,45 +0,0 @@
-package de.jplag.java17;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/** See https://svn.ipd.kit.edu/trac/de/jplag/ticket/58 */
-public class Bug58 {
-	private static File srcTestResources;
-
-	@BeforeClass
-	public static void getPaths() {
-		srcTestResources = new File(System.getProperty("user.dir"), "src/test/resources");
-	}
-
-	@Test
-	public void parseEmptyFile() throws IOException {
-		parseWithActualParser(new File(srcTestResources, "EmptyFile.java"));
-	}
-
-	@Test
-	public void parseEmptyFileOnlyComments() throws IOException {
-		parseWithActualParser(new File(srcTestResources, "EmptyFileOnlyComments.java"));
-	}
-
-	@Test
-	public void parseEmptyFileOnlyOneComment() throws IOException {
-		parseWithActualParser(new File(srcTestResources, "EmptyFileOneComment.java"));
-	}
-
-	/**
-	 * Uses the actual parser component (not only the antlr parser but the de.jplag
-	 * frontend) to parse a file. Should throw no errors and exceptions :)
-	 * 
-	 * @param file
-	 *            file to parse
-	 */
-	private void parseWithActualParser(File file) {
-		Parser parser = new Parser();
-		parser.setProgram(new de.jplag.StrippedProgram());
-		parser.parse(null, new String[] { file.toString() });
-	}
-}

+ 0 - 296
jplag.frontend.java-1.7/src/test/java/de/jplag/java17/ParserTest.java

@@ -1,296 +0,0 @@
-package de.jplag.java17;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-
-import org.antlr.v4.runtime.CharStream;
-import org.antlr.v4.runtime.CharStreams;
-import org.antlr.v4.runtime.CommonTokenStream;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import de.jplag.StrippedProgram;
-import de.jplag.java17.grammar.Java7Lexer;
-import de.jplag.java17.grammar.Java7Parser;
-
-public class ParserTest {
-
-	private static File srcTestResources;
-
-	@BeforeClass
-	public static void getPaths() {
-		srcTestResources = new File(System.getProperty("user.dir"), "src/test/resources");
-	}
-
-	/**
-	 * Parses a (useless) class that uses all the fancy Java 7 syntax features
-	 * that I was able to find so far. The output is not compared to anything.
-	 * This test should only assure that we have covered all new features with
-	 * the grammar.
-	 * 
-	 * @throws IOException
-	 */
-	@Test
-	public void testTheNewFancyJava7Features() throws IOException {
-		File file = new File(srcTestResources, "Java7FeatureTest.java");
-		FileInputStream fis = new FileInputStream(file);
-		CharStream input = CharStreams.fromStream(fis);
-		Java7Lexer lexer = new Java7Lexer(input);
-		CommonTokenStream tokens = new CommonTokenStream(lexer);
-		Java7Parser parser = new Java7Parser(tokens);
-		parser.compilationUnit();
-	}
-
-	@Ignore
-	public void j7Template() throws IOException {
-		File file = new File(srcTestResources, "J7StringSwitch.java");
-		String expected = ""// @formatter:off
-				+ "********\n"; // @formatter:on
-		String tokens = parseWithJ7Parser(file, false);
-		assertEquals(expected, tokens);
-	}
-
-	/**
-	 * added for ticket #58
-	 */
-	@Test
-	public void emptyFileOnlyComments() throws IOException {
-		compareWithParser15(new File(srcTestResources, "EmptyFileOnlyComments.java"));
-	}
-
-	@Test
-	public void emptyFile() throws IOException {
-		compareWithParser15(new File(srcTestResources, "EmptyFile.java"));
-	}
-
-	@Test
-	public void j7StringSwitchTest() throws IOException {
-		File file = new File(srcTestResources, "J7StringSwitch.java");
-		String expected ="" // @formatter:off
-				+"CLASS{  \n"
-				+"VOID    \n"
-				+"METHOD{ \n"
-				+"SWITCH{ \n"
-				+"CASE    \n"
-				+"BREAK   \n"
-				+"CASE    \n"
-				+"CASE    \n"
-				+"BREAK   \n"
-				+"CASE    \n"
-				+"BREAK   \n"
-				+"}SWITCH \n"
-				+"}METHOD \n"
-				+"}CLASS  \n"
-				+ "********\n"; // @formatter:on
-		String tokens = parseWithJ7Parser(file, false);
-		assertEquals(expected, tokens);
-	}
-
-	@Test
-	public void j7TryCatchTest() throws IOException {
-		File file = new File(srcTestResources, "J7TryCatch.java");
-		String expected ="IMPORT  \n" // @formatter:off
-				+"IMPORT  \n"
-				+"IMPORT  \n"
-				+"CLASS{  \n"
-				+"VOID    \n"
-				+"METHOD{ \n"
-				+"TRY{    \n"
-				+"CATCH{  \n"
-				+"}CATCH  \n"
-				+"FINALLY \n"
-				+"}METHOD \n"
-				+"VOID    \n"
-				+"METHOD{ \n"
-				+"TRY{    \n"
-				+"TRY_RES \n"
-				+"NEWCLASS\n"
-				+"APPLY   \n"
-				+"CATCH{  \n"
-				+"}CATCH  \n"
-				+"}METHOD \n"
-				+"VOID    \n"
-				+"METHOD{ \n"
-				+"TRY{    \n"
-				+"TRY_RES \n"
-				+"NEWCLASS\n"
-				+"TRY_RES \n"
-				+"NEWCLASS\n"
-				+"APPLY   \n"
-				+"CATCH{  \n"
-				+"}CATCH  \n"
-				+"}METHOD \n"
-				+"VOID    \n"
-				+"METHOD{ \n"
-				+"TRY{    \n"
-				+"APPLY   \n"
-				+"CATCH{  \n"
-				+"}CATCH  \n"
-				+"}METHOD \n"
-				+"VOID    \n"
-				+"METHOD{ \n"
-				+"TRY{    \n"
-				+"APPLY   \n"
-				+"CATCH{  \n"
-				+"}CATCH  \n"
-				+"CATCH{  \n"
-				+"}CATCH  \n"
-				+"}METHOD \n"
-				+"}CLASS  \n"
-				+"********\n";// @formatter:on
-
-		String tokens = parseWithJ7Parser(file, false);
-		assertEquals(expected, tokens);
-	}
-
-	@Test
-	public void compArray() throws IOException {
-		compareWithParser15(new File(srcTestResources, "ArrayTest.java"));
-	}
-
-	@Test
-	public void compSimpleClass() throws IOException {
-		compareWithParser15(new File(srcTestResources, "SimpleClass.java"));
-	}
-
-	@Test
-	public void compEnum() {
-		compareWithParser15(new File(srcTestResources, "EnumTest.java"));
-	}
-
-	@Test
-	public void compGeneric() {
-		compareWithParser15(new File(srcTestResources, "GenericPocket.java"));
-	}
-
-	@Test
-	public void compInnerClass() {
-		compareWithParser15(new File(srcTestResources, "InnerClass.java"));
-	}
-
-	@Test
-	public void compAnonymousClass() {
-		compareWithParser15(new File(srcTestResources, "AnonymousClass.java"));
-	}
-
-	@Test
-	public void compAnnotations_Usage() {
-		compareWithParser15(new File(srcTestResources, "AnnotationText.java"));
-	}
-
-	@Test
-	public void compAnnotations_PackageUsage() {
-		compareWithParser15(new File(srcTestResources, "package-info.java"));
-	}
-
-	@Test
-	public void compAnnotations_Definition() {
-		compareWithParser15(new File(srcTestResources, "OptimizeAnnotation.java"));
-	}
-
-	@Test
-	public void j7Generics() throws IOException {
-		File file = new File(srcTestResources, "J7Generics.java");
-		String expected = ""// @formatter:off
-				+ "CLASS{  \n"
-				+ "VOID    \n"
-				+ "METHOD{ \n"
-				+ "GENERIC \n"
-				+ "VARDEF  \n"
-				+ "ASSIGN  \n"
-				+ "GENERIC \n"
-				+ "NEWCLASS\n"
-				+ "}METHOD \n"
-				+ "}CLASS  \n"
-				+ "********\n"; // @formatter:on
-		String tokens = parseWithJ7Parser(file, false);
-		assertEquals(expected, tokens);
-	}
-
-	@Test
-	public void assureBackwardsCompatibility2() throws IOException {
-		compareWithParser15(new File(srcTestResources, "ExceptionTwo.java"));
-	}
-
-	@Test
-	public void assureBackwardsCompatibility3() throws IOException {
-		compareWithParser15(new File(srcTestResources, "ExceptionThree.java"));
-	}
-
-	@Test
-	public void assureBackwardsCompatibility4() throws IOException {
-		compareWithParser15(new File(srcTestResources, "Calendar.java"));
-	}
-
-	/**
-	 * Compare results (token sequence) with Java 1.5 parser (without method
-	 * separators ; if you know why they exist, PLEASE tell us or document at
-	 * https://svn.ipd.kit.edu/trac/de/jplag/wiki/Server/Frontends/Java-1.5)
-	 * 
-	 * @param javaFile
-	 * @throws IOException
-	 */
-	private void compareWithParser15(File javaFile) {
-		if (!javaFile.exists()) {
-			fail("Test not implemented - cannot find file >" + javaFile + "<");
-		}
-		String newTokens = parseWithJ7Parser(javaFile, true);
-		String oldTokens = parseWithJ5Parser(javaFile);
-		// compare token sequence?
-		Assert.assertEquals(oldTokens, newTokens);
-	}
-
-	private String parseWithJ5Parser(File javaFile) {
-
-		// parse with old parser
-		de.jplag.java15.Parser oldParser = new de.jplag.java15.Parser(false);
-		oldParser.setProgram(new StrippedProgram());
-		de.jplag.TokenList oldStruct = oldParser.parse(javaFile.getParentFile(), new String[] { javaFile.getName() });
-
-		String oldTokens = buildTokenString(oldStruct, true);
-		return oldTokens;
-	}
-
-	/**
-	 * assumes that the token types have not changed from java 1.5 to Java 1.7
-	 * (meaning the integer values are the same but Java 1.7 has more than Java
-	 * 1.5)
-	 * 
-	 * @see de.jplag.java17.JavaToken
-	 * 
-	 * @param oldStruct
-	 * @param withDetails
-	 * @return
-	 */
-	private String buildTokenString(de.jplag.TokenList oldStruct, boolean withDetails) {
-		StringBuilder sb = new StringBuilder();
-		for (int i = 0; i < oldStruct.size(); i++) {
-			sb.append(de.jplag.java17.JavaToken.type2string(oldStruct.getToken(i).type));
-			if (withDetails) {
-				sb.append(" L:" + oldStruct.getToken(i).getLine()  
-				+ " C:" + oldStruct.getToken(i).getLine()
-				+ " l:" + oldStruct.getToken(i).getLine());
-			}
-			sb.append("\n");
-		}
-
-		String oldTokens = sb.toString();
-		return oldTokens;
-	}
-
-	private String parseWithJ7Parser(File javaFile, boolean withDetails) {
-		// parse with new parser
-		de.jplag.java17.Parser newParser = new Parser();
-		newParser.setProgram(new StrippedProgram());
-		de.jplag.TokenList newStruct = newParser.parse(javaFile.getParentFile(), new String[] { javaFile.getName() });
-
-		String newTokens = buildTokenString(newStruct, withDetails);
-		return newTokens;
-	}
-}

+ 0 - 22
jplag.frontend.java-1.7/src/test/resources/AnnotationText.java

@@ -1,22 +0,0 @@
-package foo;
-
-@SuppressWarnings("unused")
-public class AnnotationText {
-
-	@SuppressWarnings("unused")
-	public AnnotationText() {
-	}
-
-	@SuppressWarnings("unused")
-	public int foo = 5;
-
-	@SuppressWarnings("unused")
-	public void bar() {
-		@SuppressWarnings("unused")
-		int i = 9;
-	}
-
-	public void param(@SuppressWarnings("unused") int i) {
-	}
-
-}

+ 0 - 15
jplag.frontend.java-1.7/src/test/resources/AnonymousClass.java

@@ -1,15 +0,0 @@
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import javax.swing.JButton;
-
-public class AnonymousClass {
-	public static void main(String[] args) {
-		JButton b = new JButton();
-		b.addActionListener(new ActionListener() {
-			public void actionPerformed(ActionEvent e) {
-			}
-		});
-	}
-
-}

+ 0 - 15
jplag.frontend.java-1.7/src/test/resources/ArrayTest.java

@@ -1,15 +0,0 @@
-public class ArrayTest {
-	public int[] intArray;
-	public int[][] intIntArray;
-	public Object[] objectArray;
-	public String[] stringArray;
-
-	public int[] intArray2 = new int[] { 1, 2 };
-	public int[][] intIntArray2 = new int[][] { { 1, 2 }, { 3, 4 } };
-	public Object[] objectArray2 = new Object[] { "1", "2" };
-	public String[] stringArray2 = new String[] { "a", "b" };
-
-	public int[] intArray3 = { 1, 2 };
-	public Object[] objectArray3 = { "ffo", "bas" };
-	public String[] stringArray3 = { "a", "b" };
-}

+ 0 - 32
jplag.frontend.java-1.7/src/test/resources/Calendar.java

@@ -1,32 +0,0 @@
-package myCal;
-public class Calendar {
-	public int numberOfDays(Month m, int year) {
-
-		if (year == 0) {
-			throw new IllegalArgumentException(
-					"There is no year zero in the traditional Christian calendar");
-		}
-
-		if (m.equals(Month.February) && isLeapYear(year)) {
-			return 29;
-		} else if (m.equals(Month.February)) {
-			return 28;
-		}
-
-		if (m.equals(Month.January) || m.equals(Month.March)
-				|| m.equals(Month.May) || m.equals(Month.July)
-				|| m.equals(Month.August) || m.equals(Month.October)
-				|| m.equals(Month.December)) {
-			return 31;
-		}
-
-		return 30;
-	}
-
-	private boolean isLeapYear(int year) {
-		if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {
-			return true;
-		}
-		return false;
-	}
-}

+ 0 - 0
jplag.frontend.java-1.7/src/test/resources/EmptyFile.java


+ 0 - 5
jplag.frontend.java-1.7/src/test/resources/EmptyFileOneComment.java

@@ -1,5 +0,0 @@
-/*
-public class EmptyFileOneComment {
-
-}
-*/

+ 0 - 2
jplag.frontend.java-1.7/src/test/resources/EmptyFileOnlyComments.java

@@ -1,2 +0,0 @@
-// stupid file
-// but that happens

+ 0 - 27
jplag.frontend.java-1.7/src/test/resources/EnumTest.java

@@ -1,27 +0,0 @@
-package de.jbb;
- 
-public enum Country {
- 
-  GERMANY ("Berlin", 82169000, 357104.07),
-  RUSSIA ("Moscow", 142400000, 17075400),
-  USA ("Washington D. C.", 304482526, 9826630),
-  FRANCE ("Paris", 64473140, 672352);
- 
-  private int inhabitants;
-  private final double area;
-  private final String capitol;
- 
-  private Land(String capitol, int inhabitants, double area) {
-    this.capitol = capitol;
-    this.inhabitants = inhabitants;
-    this.area = area;
-  }
- 
-  public int getInhabitantsPerSquareKilometers() {
-    return (int)(this.inhabitants / this.area);
-  }
- 
-  public void setInhabitants(int inhabitants) { this.inhabitants = inhabitants; }
- 
-  public String getCapitol() { return this.capitol; }
-}

+ 0 - 7
jplag.frontend.java-1.7/src/test/resources/ExceptionOne.java

@@ -1,7 +0,0 @@
-import java.util.*;
-
-public class ExceptionOne extends Exception {
-	public void foo() {
-		System.out.println("foo");
-	}
-}

+ 0 - 5
jplag.frontend.java-1.7/src/test/resources/ExceptionThree.java

@@ -1,5 +0,0 @@
-public class ExceptionThree extends Exception {
-	static {
-		System.out.println("bla");
-	}
-}

+ 0 - 7
jplag.frontend.java-1.7/src/test/resources/ExceptionTwo.java

@@ -1,7 +0,0 @@
-
-public class ExceptionTwo extends Exception {
-	public static boolean foo() {
-		System.out.println("foo");
-		return false;
-	}
-}

+ 0 - 31
jplag.frontend.java-1.7/src/test/resources/GenericPocket.java

@@ -1,31 +0,0 @@
-
-public class GenericPocket<T> {
-	private T value;
-
-	public GenericPocket() {
-	}
-
-	public GenericPocket(T value) {
-		this.value = value;
-	}
-
-	public void set(T value) {
-		this.value = value;
-	}
-
-	public T get() {
-		return value;
-	}
-
-	public boolean isEmpty() {
-		return value != null;
-	}
-
-	public void empty() {
-		value = null;
-	}
-
-	public void main(String[] args) {
-		GenericPocket<String> pocket = new GenericPocket<String>();
-	}
-}

+ 0 - 24
jplag.frontend.java-1.7/src/test/resources/IfElsifElse.java

@@ -1,24 +0,0 @@
-public class IfElsifElse {
-	public static void main(String[] args) {
-		if (true) {
-		}
-
-		if (false) {
-		} else {
-		}
-
-		if (false) {
-		} else if (false) {
-		} else {
-		}
-
-		if (false) {
-		} else if (false) {
-		} else {
-		}
-		if (false) {
-		} else if (false) {
-		} else if (false) {
-		}
-	}
-}

+ 0 - 21
jplag.frontend.java-1.7/src/test/resources/InnerClass.java

@@ -1,21 +0,0 @@
-
-public class InnerClass {
-	public void foo() {
-	}
-
-	public class Bar {
-		public void bar() {
-		}
-	}
-	
-	public class Bar {
-		public class BBar {}
-		private class BFoo {}
-	}
-
-	private class BarFoo {
-		public void barFoo() {
-		}
-	}
-
-}

+ 0 - 5
jplag.frontend.java-1.7/src/test/resources/J7Generics.java

@@ -1,5 +0,0 @@
-public class J7Generics {
-	public static void main(String[] args) {
-		GenericPocket<String> pocketNew = new GenericPocket<>();
-	}
-}

+ 0 - 13
jplag.frontend.java-1.7/src/test/resources/J7StringSwitch.java

@@ -1,13 +0,0 @@
-public class J7StringSwitch {					// CLASS{
-	private void stringSwitch(String foo) {		// VOID, METHOD{
-		switch (foo) {							// SWITCH{
-		case "new":								// CASE
-			break;								// BREAK
-		case "exec":							// CASE
-		case "pend":							// CASE
-			break;								// BREAK
-		default:								// CASE
-			break;								// BREAK
-		}										// }SWITCH
-	}											// }METHOD
-}												// }CLASS

+ 0 - 43
jplag.frontend.java-1.7/src/test/resources/J7TryCatch.java

@@ -1,43 +0,0 @@
-import java.io.DataOutputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-
-public class J7TryCatch {
-	
-	public void simpleTry() {
-		try {
-		} catch (Exception e) {
-		} finally {
-		}
-	}
-	
-	public void tryWithResource(FileOutputStream fos) {
-		try (DataOutputStream dos = new DataOutputStream(fos)) {
-			dos.writeUTF("Java 7 Block Buster");
-		} catch (IOException e) {
-		}
-	}
-	
-	public void tryWithResources() {
-		try (FileOutputStream fos = new FileOutputStream("movies.txt"); DataOutputStream dos = new DataOutputStream(fos)) {
-			dos.writeUTF("Java 7 Block Buster");
-		} catch (IOException e) {
-		}
-	}
-	
-	public void newMultiCatch() {
-		try {
-			methodThatThrowsThreeExceptions();
-		} catch (ExceptionOne | ExceptionTwo | ExceptionThree e) {
-		}
-	}
-
-	public void newMultiMultiCatch() {
-		try {
-			methodThatThrowsThreeExceptions();
-		} catch (ExceptionOne e) {
-		} catch (ExceptionTwo | ExceptionThree e) {
-		}
-	}
-}

+ 0 - 112
jplag.frontend.java-1.7/src/test/resources/Java7FeatureTest.java

@@ -1,112 +0,0 @@
-import java.io.DataOutputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-
-public class Java7FeatureTest {
-
-	int thousand = 1_000;
-	int million = 1_000_000;
-
-	int foo = 1234_5678;
-	long l = 1_2_3_4__5_6_7_8L;
-	int binary = 0b0001_0010_0100_1000;
-
-	int mask = 0b1010_1010_1010;
-	long big = 9_223_783_036_967_937L;
-	long creditCardNumber = 1234_5678_9012_3456L;
-	long socialSecurityNumber = 999_99_9999L;
-	float pi = 3.14_15F;
-	long hexBytes = 0xFF_EC_DE_5E;
-	long hexWords = 0xCAFE_BFFE;
-
-	public static void diamondOperator() {
-		// old
-		Map<String, List<Object>> tradesOld = new TreeMap<String, List<Object>>();
-
-		// new
-		Map<String, List<Object>> trades = new TreeMap<>();
-	}
-
-	private void stringSwitch(String foo) {
-
-		// old
-		if (foo.equalsIgnoreCase("new")) {
-		} else if (foo.equalsIgnoreCase("exec")) {
-		} else if (foo.equalsIgnoreCase("pend")) {
-		}
-
-		// new
-		switch (foo) {
-		case "new":
-			break;
-		case "exec":
-			break;
-		case "pend":
-			break;
-		default:
-			break;
-		}
-	}
-
-	public void oldTry() {
-		FileOutputStream fos = null;
-		DataOutputStream dos = null;
-		try {
-			fos = new FileOutputStream("movies.txt");
-			dos = new DataOutputStream(fos);
-			dos.writeUTF("Java 7 Block Buster");
-		} catch (IOException e) {
-			e.printStackTrace();
-		} finally {
-			try {
-				fos.close();
-				dos.close();
-			} catch (IOException e) {
-			}
-		}
-	}
-
-	public void newTry() {
-		try (FileOutputStream fos = new FileOutputStream("movies.txt"); DataOutputStream dos = new DataOutputStream(fos)) {
-			dos.writeUTF("Java 7 Block Buster");
-		} catch (IOException e) {
-		}
-	}
-
-	public void oldMultiCatch() {
-		try {
-			methodThatThrowsThreeExceptions();
-		} catch (ExceptionOne e) {
-		} catch (ExceptionTwo e) {
-		} catch (ExceptionThree e) {
-		}
-	}
-
-	public void newMultiCatch() {
-		try {
-			methodThatThrowsThreeExceptions();
-		} catch (ExceptionOne | ExceptionTwo | ExceptionThree e) {
-		}
-	}
-
-	public void newMultiMultiCatch() {
-		try {
-			methodThatThrowsThreeExceptions();
-		} catch (ExceptionOne e) {
-		} catch (ExceptionTwo | ExceptionThree e) {
-		}
-	}
-
-	private void methodThatThrowsThreeExceptions() throws ExceptionOne, ExceptionTwo, ExceptionThree {
-	}
-
-	public void foo(String bar) throws ExceptionOne, ExceptionTwo {
-		try {
-		} catch (Exception e) {
-			throw e;
-		}
-	}
-}

+ 0 - 31
jplag.frontend.java-1.7/src/test/resources/OptimizeAnnotation.java

@@ -1,31 +0,0 @@
-package foo;
-import static java.lang.annotation.ElementType.CONSTRUCTOR;
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PACKAGE;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.ElementType.TYPE;
-
-import java.lang.annotation.Target;
-
-public @interface OptimizeAnnotation {
-	String value();
-
-	String assignedTo();
-
-	String assignedToDefault() default "";
-
-	String[] assignedToMany();
-
-	String[] assignedToNone();
-
-	int priority();
-
-	enum Priority {
-		LOW, NORM, HIGH;
-	}
-
-	Priority prio();
-
-}

+ 0 - 13
jplag.frontend.java-1.7/src/test/resources/SimpleClass.java

@@ -1,13 +0,0 @@
-import java.lang.*;
-import java.awt.*;
-
-public class SimpleClass {
-	public SimpleClass() {
-	}
-
-	public SimpleClass(int i) {
-	}
-
-	public SimpleClass(String a) {
-	}
-}

+ 0 - 2
jplag.frontend.java-1.7/src/test/resources/package-info.java

@@ -1,2 +0,0 @@
-@SuppressWarnings("unused")
-package foo;

+ 3 - 3
jplag.frontend.java-1.9/pom.xml → jplag.frontend.java/pom.xml

@@ -2,7 +2,7 @@
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
-  <artifactId>java-1.9</artifactId>
+  <artifactId>java</artifactId>
   <version>0.0.1-SNAPSHOT</version>
 
   <build>
@@ -14,8 +14,8 @@
         <configuration>
           <archive>
             <manifest>
-              <mainClass>de.jplag.java19.Parser</mainClass>
-              <packageName>jplag.java19</packageName>
+              <mainClass>de.jplag.java.Parser</mainClass>
+              <packageName>jplag.java</packageName>
             </manifest>
           </archive>
         </configuration>

+ 1 - 1
jplag.frontend.java-1.9/src/main/java/de/jplag/java19/JavaToken.java → jplag.frontend.java/src/main/java/de/jplag/java/JavaToken.java

@@ -1,4 +1,4 @@
-package de.jplag.java19;
+package de.jplag.java;
 
 import de.jplag.Token;
 

+ 1 - 1
jplag.frontend.java-1.9/src/main/java/de/jplag/java19/JavaTokenConstants.java → jplag.frontend.java/src/main/java/de/jplag/java/JavaTokenConstants.java

@@ -1,4 +1,4 @@
-package de.jplag.java19;
+package de.jplag.java;
 
 import de.jplag.TokenConstants;
 

+ 1 - 1
jplag.frontend.java-1.9/src/main/java/de/jplag/java19/JavacAdapter.java → jplag.frontend.java/src/main/java/de/jplag/java/JavacAdapter.java

@@ -1,4 +1,4 @@
-package de.jplag.java19;
+package de.jplag.java;
 
 import java.io.File;
 import java.io.IOException;

+ 1 - 1
jplag.frontend.java-1.9/src/main/java/de/jplag/java19/Language.java → jplag.frontend.java/src/main/java/de/jplag/java/Language.java

@@ -1,4 +1,4 @@
-package de.jplag.java19;
+package de.jplag.java;
 
 import java.io.File;
 

+ 1 - 1
jplag.frontend.java-1.9/src/main/java/de/jplag/java19/Parser.java → jplag.frontend.java/src/main/java/de/jplag/java/Parser.java

@@ -1,4 +1,4 @@
-package de.jplag.java19;
+package de.jplag.java;
 
 import java.io.File;
 

+ 1 - 1
jplag.frontend.java-1.9/src/main/java/de/jplag/java19/TokenGeneratingTreeScanner.java → jplag.frontend.java/src/main/java/de/jplag/java/TokenGeneratingTreeScanner.java

@@ -1,4 +1,4 @@
-package de.jplag.java19;
+package de.jplag.java;
 
 import com.sun.source.tree.AnnotationTree;
 import com.sun.source.tree.AssertTree;

+ 1 - 16
jplag.parent/pom.xml

@@ -156,11 +156,6 @@
   </dependencies>
   <dependencyManagement>
     <dependencies>
-      <dependency>
-        <groupId>de.jplag</groupId>
-        <artifactId>java-1.1exp</artifactId>
-        <version>0.0.1-SNAPSHOT</version>
-      </dependency>
       <dependency>
         <groupId>de.jplag</groupId>
         <artifactId>text</artifactId>
@@ -168,12 +163,7 @@
       </dependency>
       <dependency>
         <groupId>de.jplag</groupId>
-        <artifactId>java-1.7</artifactId>
-        <version>0.0.1-SNAPSHOT</version>
-      </dependency>
-      <dependency>
-        <groupId>de.jplag</groupId>
-        <artifactId>java-1.9</artifactId>
+        <artifactId>java</artifactId>
         <version>0.0.1-SNAPSHOT</version>
       </dependency>
       <dependency>
@@ -241,11 +231,6 @@
         <artifactId>jplag</artifactId>
         <version>3.0.0-SNAPSHOT</version>
       </dependency>
-      <dependency>
-        <groupId>de.jplag</groupId>
-        <artifactId>java-1.5</artifactId>
-        <version>0.0.1-SNAPSHOT</version>
-      </dependency>
     </dependencies>
   </dependencyManagement>
   <name>JPlag Plagiarism Detector</name>

+ 1 - 16
jplag/pom.xml

@@ -162,11 +162,6 @@
       <artifactId>frontend-utils</artifactId>
     </dependency>
 
-    <dependency>
-      <groupId>de.jplag</groupId>
-      <artifactId>java-1.1exp</artifactId>
-    </dependency>
-
     <dependency>
       <groupId>de.jplag</groupId>
       <artifactId>text</artifactId>
@@ -174,17 +169,7 @@
 
     <dependency>
       <groupId>de.jplag</groupId>
-      <artifactId>java-1.5</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>de.jplag</groupId>
-      <artifactId>java-1.7</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>de.jplag</groupId>
-      <artifactId>java-1.9</artifactId>
+      <artifactId>java</artifactId>
     </dependency>
 
     <dependency>

+ 1 - 1
jplag/src/main/java/de/jplag/options/LanguageOption.java

@@ -14,7 +14,7 @@ public enum LanguageOption {
     JAVA_1_5("java5", "de.jplag.java15.Language"),
     JAVA_1_5_DM("java5dm", "de.jplag.java15.LanguageWithDelimitedMethods"),
     JAVA_1_7("java7", "de.jplag.java17.Language"),
-    JAVA_1_9("java9", "de.jplag.java19.Language"),
+    JAVA_1_9("java9", "de.jplag.java.Language"),
     PYTHON_3("python3", "de.jplag.python3.Language"),
     C_CPP("cpp", "de.jplag.cpp.Language"),
     C_SHARP("csharp", "de.jplag.csharp.Language"),

+ 1 - 14
pom.xml

@@ -14,23 +14,10 @@
     <module>jplag.frontend.chars</module>
     <module>jplag.frontend.cpp</module>
     <module>jplag.frontend.csharp-1.2</module>
-    <module>jplag.frontend.java-1.1exp</module>
-    <module>jplag.frontend.java-1.2</module>
-    <module>jplag.frontend.java-1.5</module>
-    <module>jplag.frontend.java-1.7</module>
-    <module>jplag.frontend.java-1.9</module>
+    <module>jplag.frontend.java</module>
     <module>jplag.frontend.python-3</module>
     <module>jplag.frontend.scheme</module>
     <module>jplag.frontend.text</module>
     <module>jplag</module>
   </modules>
-  <dependencyManagement>
-    <dependencies>
-      <dependency>
-        <groupId>de.jplag</groupId>
-        <artifactId>java-1.5</artifactId>
-        <version>0.0.1-SNAPSHOT</version>
-      </dependency>
-    </dependencies>
-  </dependencyManagement>
 </project>