Przeglądaj źródła

Adapt all instances of the term frontend to the new term (language) module.

Timur Sağlam 4 lat temu
rodzic
commit
52ff41ca90
24 zmienionych plików z 72 dodań i 73 usunięć
  1. 1 1
      core/src/main/java/de/jplag/SubmissionSetBuilder.java
  2. 2 2
      core/src/test/resources/de/jplag/samples/PartialPlagiarism/A/Token.java
  3. 1 1
      language-api/src/main/java/de/jplag/LanguageLoader.java
  4. 1 1
      language-api/src/main/java/de/jplag/TokenPrinter.java
  5. 4 4
      languages/csharp/src/test/java/de/jplag/csharp/MinimalCSharpTest.java
  6. 1 1
      languages/csharp/src/test/resources/de/jplag/csharp/TestClass.cs
  7. 5 6
      languages/emf-metamodel-dynamic/README.md
  8. 3 3
      languages/emf-metamodel-dynamic/src/test/java/de/jplag/emf/dynamic/MinimalDynamicMetamodelTest.java
  9. 5 5
      languages/emf-metamodel/README.md
  10. 3 3
      languages/emf-metamodel/src/test/java/de/jplag/emf/MinimalMetamodelTest.java
  11. 2 2
      languages/golang/src/test/java/de/jplag/golang/GoLanguageTest.java
  12. 4 4
      languages/kotlin/README.md
  13. 2 2
      languages/kotlin/src/test/java/de/jplag/kotlin/KotlinLanguageTest.java
  14. 5 5
      languages/rlang/README.md
  15. 3 3
      languages/rlang/src/main/java/de/jplag/rlang/JPlagRListener.java
  16. 1 1
      languages/rlang/src/main/java/de/jplag/rlang/RParserAdapter.java
  17. 1 1
      languages/rlang/src/main/java/de/jplag/rlang/RTokenType.java
  18. 2 2
      languages/rlang/src/test/java/de/jplag/rlang/RLanguageTest.java
  19. 7 7
      languages/rust/README.md
  20. 1 1
      languages/rust/src/main/java/de/jplag/rust/Language.java
  21. 2 2
      languages/rust/src/test/java/de/jplag/rust/RustLanguageTest.java
  22. 8 8
      languages/scala/README.md
  23. 2 2
      languages/scala/src/test/java/de/jplag/scala/ScalaLanguageTest.java
  24. 6 6
      languages/text/src/test/java/jplag/text/TextLanguageTest.java

+ 1 - 1
core/src/main/java/de/jplag/SubmissionSetBuilder.java

@@ -323,7 +323,7 @@ public class SubmissionSetBuilder {
     private boolean hasValidSuffix(File file) {
         List<String> validSuffixes = options.fileSuffixes();
 
-        // This is the case if either the language frontends or the CLI did not set the valid suffixes array in options
+        // This is the case if either the language modules or the CLI did not set the valid suffixes array in options
         if (validSuffixes == null || validSuffixes.isEmpty()) {
             return true;
         }

+ 2 - 2
core/src/test/resources/de/jplag/samples/PartialPlagiarism/A/Token.java

@@ -29,8 +29,8 @@ public abstract class Token implements TokenConstants, Serializable {
 	protected void setColumn(int line) {}
 	protected void setLength(int line) {}
 	
-	// this is made to distinguish the character front end.
-	// maybe other front ends can use it too?
+	// this is made to distinguish the character module.
+	// maybe other modules can use it too?
 	protected int getIndex() { return -1; }
 	
 	public static String type2string(int type) {

+ 1 - 1
language-api/src/main/java/de/jplag/LanguageLoader.java

@@ -36,7 +36,7 @@ public final class LanguageLoader {
                 languages.remove(languageIdentifier);
                 continue;
             }
-            logger.debug("Loading Language Frontend '{}'", language.getName());
+            logger.debug("Loading Language Module '{}'", language.getName());
             languages.put(languageIdentifier, language);
         }
         logger.info("Available languages: '{}'", languages.values().stream().map(Language::getName).toList());

+ 1 - 1
language-api/src/main/java/de/jplag/TokenPrinter.java

@@ -263,7 +263,7 @@ public final class TokenPrinter {
         /**
          * Appends whitespace padding to the given StringBuilder in order to reach the targetPosition. Note that <b>the indices
          * are 1-based</b>, whereas the positions in currentLine are 0-based. The convention that lines start at position 1
-         * comes from the frontends, specifically the Java frontend.
+         * comes from the modules, specifically the Java module.
          * @param currentLine The current line in the code file, indicating where it containes tab characters
          * @param targetPosition The (1-based) index of the next character within the currentLine that should be labeled
          * @param breakLine If true, a lineSeparator will be added if the currentPosition is past targetPosition.

+ 4 - 4
languages/csharp/src/test/java/de/jplag/csharp/MinimalCSharpFrontendTest.java → languages/csharp/src/test/java/de/jplag/csharp/MinimalCSharpTest.java

@@ -18,18 +18,18 @@ import de.jplag.Token;
 import de.jplag.TokenPrinter;
 import de.jplag.TokenType;
 
-class MinimalCSharpFrontendTest {
+class MinimalCSharpTest {
     private final Logger logger = LoggerFactory.getLogger("JPlag-Test");
 
     private static final Path BASE_PATH = Path.of("src", "test", "resources", "de", "jplag", "csharp");
     private static final String TEST_SUBJECT = "TestClass.cs";
 
-    private de.jplag.Language frontend;
+    private de.jplag.Language language;
     private File baseDirectory;
 
     @BeforeEach
     public void setUp() {
-        frontend = new Language();
+        language = new Language();
         baseDirectory = BASE_PATH.toFile();
         assertTrue(baseDirectory.exists(), "Could not find base directory!");
     }
@@ -43,7 +43,7 @@ class MinimalCSharpFrontendTest {
 
         // Parse test input
         String[] input = new String[] {TEST_SUBJECT};
-        List<Token> result = frontend.parse(baseDirectory, input);
+        List<Token> result = language.parse(baseDirectory, input);
         logger.info(TokenPrinter.printTokens(result, baseDirectory));
 
         // Compare parsed tokens:

+ 1 - 1
languages/csharp/src/test/resources/de/jplag/csharp/TestClass.cs

@@ -1,5 +1,5 @@
 /**
- * Class for testing the C# language frontend.
+ * Class for testing the C# language module.
  */
 public class MyClass
 {

+ 5 - 6
languages/emf-metamodel-dynamic/README.md

@@ -1,16 +1,15 @@
-# Dynamic EMF metamodel language frontend
-The dynamic EMF metamodel language frontend allows the use of JPlag with metamodel submissions.
+# Dynamic EMF metamodel language module
+The dynamic EMF metamodel language module allows the use of JPlag with metamodel submissions.
 It is based on the EMF API.
 
 ### EMF specification compatibility
-This frontend is based on the EMF dependencies available on maven central. These might not be the newest versions of EMF. For details, the [JPlag aggregator pom](https://github.com/jplag/JPlag/blob/263e85e544152cc8b0caa3399127debb7a458746/pom.xml#L84-L86).
+This module is based on the EMF dependencies available on maven central. These might not be the newest versions of EMF. For details, the [JPlag aggregator pom](https://github.com/jplag/JPlag/blob/263e85e544152cc8b0caa3399127debb7a458746/pom.xml#L84-L86).
 
 ### Token Extraction
-For the token extraction, we visit the containment tree of the metamodel and extract tokens for certain metamodel elements based on their metaclass. In this module, we extract tokens based on a [handcrafted token set](https://github.com/jplag/JPlag/blob/263e85e544152cc8b0caa3399127debb7a458746/jplag.frontend.emf-metamodel/src/main/java/de/jplag/emf/MetamodelTokenConstants.java). Note that not for all concrete metaclasses tokens are extracted. `EFactory`, `EGenericType`, and `EObject` are ignored. Moreover, for some metaclasses, multiple token types are extracted. Finally, some references are also used for token extraction.
- 
+For the token extraction, we visit the containment tree of the metamodel and extract tokens for all metamodel elements based on their concrete metaclass. In this module, we thus extract tokens based on a dynamic token set.
 
 ### Usage
-To use this frontend, add the `-l emf-metamodel` flag in the CLI, or use a `JPlagOption` object set to `LanguageOption.EMF` in the Java API as described in the usage information in the [readme of the main project](https://github.com/jplag/JPlag#usage) and [in the wiki](https://github.com/jplag/JPlag/wiki/1.-How-to-Use-JPlag).
+To use this module, add the `-l emf-metamodel-dynamic` flag in the CLI, or use a `JPlagOption` object set to `LanguageOption.EMF_DYNAMIC` in the Java API as described in the usage information in the [readme of the main project](https://github.com/jplag/JPlag#usage) and [in the wiki](https://github.com/jplag/JPlag/wiki/1.-How-to-Use-JPlag).
 
 ### More Info
 More information can be found in the paper *"Token-based Plagiarism Detection for Metamodels"* (MODELS-C 2022, accepted for publication, link coming soon). 

+ 3 - 3
languages/emf-metamodel-dynamic/src/test/java/de/jplag/emf/dynamic/MinimalDynamicMetamodelTest.java

@@ -28,19 +28,19 @@ class MinimalDynamicMetamodelTest {
     private static final Path BASE_PATH = Path.of("src", "test", "resources", "de", "jplag", "models");
     private static final String[] TEST_SUBJECTS = {"bookStore.ecore", "bookStoreExtended.ecore", "bookStoreRenamed.ecore"};
 
-    private de.jplag.Language frontend;
+    private de.jplag.Language language;
     private File baseDirectory;
 
     @BeforeEach
     public void setUp() {
-        frontend = new Language();
+        language = new Language();
         baseDirectory = BASE_PATH.toFile();
         FileUtil.assertDirectory(baseDirectory, TEST_SUBJECTS);
     }
 
     @Test
     void testBookstoreMetamodels() {
-        List<Token> result = frontend.parse(baseDirectory, TEST_SUBJECTS);
+        List<Token> result = language.parse(baseDirectory, TEST_SUBJECTS);
         List<TokenType> tokenTypes = result.stream().map(Token::getType).toList();
         logger.debug(TokenPrinter.printTokens(result, baseDirectory, Optional.of(Language.VIEW_FILE_SUFFIX)));
         logger.info("parsed token types: " + tokenTypes.stream().map(TokenType::getDescription).toList().toString());

+ 5 - 5
languages/emf-metamodel/README.md

@@ -1,15 +1,15 @@
-# EMF metamodel language frontend
-The EMF metamodel language frontend allows the use of JPlag with metamodel submissions.
+# EMF metamodel language module
+The EMF metamodel language module allows the use of JPlag with metamodel submissions.
 It is based on the EMF API.
 
 ### EMF specification compatibility
-This frontend is based on the EMF dependencies available on maven central. These might not be the newest versions of EMF. For details, the [JPlag aggregator pom](https://github.com/jplag/JPlag/blob/263e85e544152cc8b0caa3399127debb7a458746/pom.xml#L84-L86).
+This module is based on the EMF dependencies available on maven central. These might not be the newest versions of EMF. For details, the [JPlag aggregator pom](https://github.com/jplag/JPlag/blob/263e85e544152cc8b0caa3399127debb7a458746/pom.xml#L84-L86).
 
 ### Token Extraction
-For the token extraction, we visit the containment tree of the metamodel and extract tokens for all metamodel elements based on their concrete metaclass. In this module, we thus extract tokens based on a [dynamic token set](https://github.com/jplag/JPlag/blob/263e85e544152cc8b0caa3399127debb7a458746/jplag.frontend.emf-metamodel-dynamic/src/main/java/de/jplag/emf/dynamic/DynamicMetamodelTokenConstants.java).
+For the token extraction, we visit the containment tree of the metamodel and extract tokens for certain metamodel elements based on their metaclass. In this module, we extract tokens based on a [handcrafted token set](https://github.com/jplag/JPlag/blob/master/languages/emf-metamodel/src/main/java/de/jplag/emf/MetamodelTokenType.java). Note that not for all concrete metaclasses tokens are extracted. `EFactory`, `EGenericType`, and `EObject` are ignored. Moreover, for some metaclasses, multiple token types are extracted. Finally, some references are also used for token extraction.
 
 ### Usage
-To use this frontend, add the `-l emf-metamodel-dynamic` flag in the CLI, or use a `JPlagOption` object set to `LanguageOption.EMF_DYNAMIC` in the Java API as described in the usage information in the [readme of the main project](https://github.com/jplag/JPlag#usage) and [in the wiki](https://github.com/jplag/JPlag/wiki/1.-How-to-Use-JPlag).
+To use this module, add the `-l emf-metamodel` flag in the CLI, or use a `JPlagOption` object set to `LanguageOption.EMF` in the Java API as described in the usage information in the [readme of the main project](https://github.com/jplag/JPlag#usage) and [in the wiki](https://github.com/jplag/JPlag/wiki/1.-How-to-Use-JPlag).
 
 ### More Info
 More information can be found in the paper *"Token-based Plagiarism Detection for Metamodels"* (MODELS-C 2022, accepted for publication, link coming soon). 

+ 3 - 3
languages/emf-metamodel/src/test/java/de/jplag/emf/MinimalMetamodelTest.java

@@ -28,19 +28,19 @@ class MinimalMetamodelTest {
     private static final Path BASE_PATH = Path.of("src", "test", "resources", "de", "jplag", "models");
     private static final String[] TEST_SUBJECTS = {"bookStore.ecore", "bookStoreExtended.ecore", "bookStoreRenamed.ecore"};
 
-    private de.jplag.Language frontend;
+    private de.jplag.Language language;
     private File baseDirectory;
 
     @BeforeEach
     public void setUp() {
-        frontend = new Language();
+        language = new Language();
         baseDirectory = BASE_PATH.toFile();
         FileUtil.assertDirectory(baseDirectory, TEST_SUBJECTS);
     }
 
     @Test
     void testBookstoreMetamodels() {
-        List<Token> result = frontend.parse(baseDirectory, TEST_SUBJECTS);
+        List<Token> result = language.parse(baseDirectory, TEST_SUBJECTS);
 
         logger.debug(TokenPrinter.printTokens(result, baseDirectory, Optional.of(Language.VIEW_FILE_SUFFIX)));
         List<TokenType> tokenTypes = result.stream().map(Token::getType).toList();

+ 2 - 2
languages/golang/src/test/java/de/jplag/golang/GoFrontendTest.java → languages/golang/src/test/java/de/jplag/golang/GoLanguageTest.java

@@ -24,7 +24,7 @@ import de.jplag.SharedTokenType;
 import de.jplag.Token;
 import de.jplag.TokenPrinter;
 
-class GoFrontendTest {
+class GoLanguageTest {
     /**
      * Test source file that is supposed to produce a complete set of tokens, i.e. all types of tokens.
      */
@@ -45,7 +45,7 @@ class GoFrontendTest {
      */
     private static final String DELIMITED_COMMENT_END = ".*\\*/\\s*$";
 
-    private final Logger logger = LoggerFactory.getLogger("GoLang frontend test");
+    private final Logger logger = LoggerFactory.getLogger("GoLang language test");
     private final String[] testFiles = new String[] {COMPLETE_TEST_FILE};
     private final File testFileLocation = Path.of("src", "test", "resources", "de", "jplag", "golang").toFile();
     private Language language;

+ 4 - 4
languages/kotlin/README.md

@@ -1,6 +1,6 @@
-# JPlag Kotlin language frontend
+# JPlag Kotlin language module
 
-The JPlag Kotlin frontend allows the use of JPlag with submissions in Kotlin. <br>
+The JPlag Kotlin module allows the use of JPlag with submissions in Kotlin. <br>
 It is based on the [Kotlin ANTLR4 grammar](https://github.com/antlr/grammars-v4/tree/master/kotlin/kotlin), licensed under the Apache 2.0.
 
 ### Kotlin specification compatibility
@@ -14,13 +14,13 @@ If there are any major updates or fixes to the grammar<a href="#footnote-1"><sup
 
 ### Token Extraction
 
-The choice of tokens is intended to be similar to the Java or C# frontends. It includes a range of nesting structures (class, method, control flow expressions) as well as variable declaration, object creation, assignment, and control flow altering keywords.
+The choice of tokens is intended to be similar to the Java or C# modules. It includes a range of nesting structures (class, method, control flow expressions) as well as variable declaration, object creation, assignment, and control flow altering keywords.
 
 More syntactic elements of Kotlin may turn out to be helpful to include in the future.
 
 ### Usage
 
-To use the Kotlin frontend, add the `-l kotlin` flag in the CLI, or use a `JPlagOption` object set to `LanguageOption.KOTLIN` in the Java API as described in the usage information in the [readme of the main project](https://github.com/jplag/JPlag#usage) and [in the wiki](https://github.com/jplag/JPlag/wiki/1.-How-to-Use-JPlag).
+To use the Kotlin module, add the `-l kotlin` flag in the CLI, or use a `JPlagOption` object set to `LanguageOption.KOTLIN` in the Java API as described in the usage information in the [readme of the main project](https://github.com/jplag/JPlag#usage) and [in the wiki](https://github.com/jplag/JPlag/wiki/1.-How-to-Use-JPlag).
 
 <br>
 

+ 2 - 2
languages/kotlin/src/test/java/de/jplag/kotlin/KotlinFrontendTest.java → languages/kotlin/src/test/java/de/jplag/kotlin/KotlinLanguageTest.java

@@ -22,7 +22,7 @@ import de.jplag.SharedTokenType;
 import de.jplag.Token;
 import de.jplag.TokenPrinter;
 
-class KotlinFrontendTest {
+class KotlinLanguageTest {
 
     /**
      * Test source file that is supposed to produce a complete set of tokens, i.e. all types of tokens.
@@ -44,7 +44,7 @@ class KotlinFrontendTest {
      */
     private static final String DELIMITED_COMMENT_END = ".*\\*/\\s*$";
 
-    private final Logger logger = LoggerFactory.getLogger("Kotlin frontend test");
+    private final Logger logger = LoggerFactory.getLogger("Kotlin language test");
     private final String[] testFiles = new String[] {COMPLETE_TEST_FILE, "Game.kt"};
     private final File testFileLocation = Path.of("src", "test", "resources", "de", "jplag", "kotlin").toFile();
     private Language language;

+ 5 - 5
languages/rlang/README.md

@@ -1,7 +1,7 @@
-# JPlag R language frontend
+# JPlag R language module
 
-The JPlag R frontend allows the use of JPlag with submissions in R. <br>
-It was in part adapted from a [JPLag fork by CodeGra-de](https://github.com/CodeGra-de/jplag/tree/master/jplag.frontend.R).
+The JPlag R module allows the use of JPlag with submissions in R. <br>
+It was in part adapted from a [JPLag fork by CodeGra-de](https://github.com/CodeGra-de/jplag/tree/master/jplag.module.R).
 
 ### R specification compatibility
 The underlying [grammar definition](https://github.com/antlr/grammars-v4/tree/master/r) was first created in June 2013, when R 3.0.1 was current. The latest commit is from April 2018, when R 3.5.0 was just released. Whether the grammar has been made to comply with any specific version of the R specification is unclear. Even if some parsing errors occur, the parser should be able to recover and still produce a valid analysis.
@@ -10,7 +10,7 @@ The underlying [grammar definition](https://github.com/antlr/grammars-v4/tree/ma
 
 The choice of tokens is based directly on the CodeGra-de version, whereas the extraction process itself contains some fixes.
 
-Like in other frontends, e.g. for Java and C#, the tokens account for the beginning and the end of control flow structures, for control flow keywords, and some kinds of expressions. As R is very different from other programming languages in JPlag, it remains to be seen whether the R frontend can hold up to the others.
+Like in other modules, e.g. for Java and C#, the tokens account for the beginning and the end of control flow structures, for control flow keywords, and some kinds of expressions. As R is very different from other programming languages in JPlag, it remains to be seen whether the R module can hold up to the others.
 
 ### Usage
-To use the R frontend, add the `-l R` flag in the CLI, or use a `JPlagOption` object set to `LanguageOption.R` in the Java API as described in the usage information in the [readme of the main project](https://github.com/jplag/JPlag#usage) and [in the wiki](https://github.com/jplag/JPlag/wiki/1.-How-to-Use-JPlag).
+To use the R module, add the `-l R` flag in the CLI, or use a `JPlagOption` object set to `LanguageOption.R` in the Java API as described in the usage information in the [readme of the main project](https://github.com/jplag/JPlag#usage) and [in the wiki](https://github.com/jplag/JPlag/wiki/1.-How-to-Use-JPlag).

+ 3 - 3
languages/rlang/src/main/java/de/jplag/rlang/JplagRListener.java → languages/rlang/src/main/java/de/jplag/rlang/JPlagRListener.java

@@ -8,11 +8,11 @@ import de.jplag.rlang.grammar.*;
 
 /**
  * Listener class for visiting the R ANTLR parse tree. Transforms the visited ANTLR token into JPlag tokens. Based on an
- * R frontend for JPlag v2.15 by Olmo Kramer, see their
+ * R module for JPlag v2.15 by Olmo Kramer, see their
  * <a href="https://github.com/CodeGra-de/jplag/tree/master/jplag.frontend.R">JPlag fork</a>.
  * @author Robin Maisch
  */
-public class JplagRListener extends RCombinedBaseListener {
+public class JPlagRListener extends RCombinedBaseListener {
 
     private final RParserAdapter parserAdapter;
 
@@ -20,7 +20,7 @@ public class JplagRListener extends RCombinedBaseListener {
      * Creates the listener.
      * @param parserAdapter the JPlag parser adapter which receives the transformed tokens.
      */
-    public JplagRListener(RParserAdapter parserAdapter) {
+    public JPlagRListener(RParserAdapter parserAdapter) {
         this.parserAdapter = parserAdapter;
     }
 

+ 1 - 1
languages/rlang/src/main/java/de/jplag/rlang/RParserAdapter.java

@@ -75,7 +75,7 @@ public class RParserAdapter extends AbstractParser {
             // Walk over the parse tree:
             for (int i = 0; i < entryContext.getChildCount(); i++) {
                 ParseTree parseTree = entryContext.getChild(i);
-                treeWalker.walk(new JplagRListener(this), parseTree);
+                treeWalker.walk(new JPlagRListener(this), parseTree);
             }
         } catch (IOException exception) {
             logger.error("Parsing Error in '" + fileName + "': " + File.separator + exception.getMessage(), exception);

+ 1 - 1
languages/rlang/src/main/java/de/jplag/rlang/RTokenType.java

@@ -3,7 +3,7 @@ package de.jplag.rlang;
 import de.jplag.TokenType;
 
 /**
- * Tokens in R that are deemed important when comparing submissions for plagiarisms. Based on an R frontend for JPlag
+ * Tokens in R that are deemed important when comparing submissions for plagiarisms. Based on an R module for JPlag
  * v2.15 by Olmo Kramer, see their <a href="https://github.com/CodeGra-de/jplag/tree/master/jplag.frontend.R">JPlag
  * fork</a>.
  */

+ 2 - 2
languages/rlang/src/test/java/de/jplag/rlang/RFrontendTest.java → languages/rlang/src/test/java/de/jplag/rlang/RLanguageTest.java

@@ -21,7 +21,7 @@ import de.jplag.SharedTokenType;
 import de.jplag.Token;
 import de.jplag.TokenPrinter;
 
-class RFrontendTest {
+class RLanguageTest {
 
     /**
      * Regular expression for lines that contain no code.
@@ -33,7 +33,7 @@ class RFrontendTest {
      */
     private static final String COMPLETE_TEST_FILE = "Complete.R";
 
-    private final Logger logger = LoggerFactory.getLogger("R frontend test");
+    private final Logger logger = LoggerFactory.getLogger("R language test");
     private final String[] testFiles = new String[] {"Game.R", COMPLETE_TEST_FILE};
     private final File testFileLocation = Path.of("src", "test", "resources", "de", "jplag", "rlang").toFile();
     private Language language;

+ 7 - 7
languages/rust/README.md

@@ -1,6 +1,6 @@
-# JPlag Rust language frontend
+# JPlag Rust language module
 
-The JPlag Rust frontend allows the use of JPlag with submissions in Scala. <br>
+The JPlag Rust module allows the use of JPlag with submissions in Scala. <br>
 It is based on the [Rust ANTLR4 grammar](https://github.com/antlr/grammars-v4/tree/master/rust), licensed under MIT.
 
 ### Rust specification compatibility
@@ -11,7 +11,7 @@ According to the grammar's documentation, it was updated to Rust 1.60.0 (April 2
 
 #### General
 
-The choice of tokens is intended to be similar to the Java or C# frontends. Specifically, among others, it includes a
+The choice of tokens is intended to be similar to the Java or C# modules. Specifically, among others, it includes a
 range of nesting structures (class and method declarations, control flow expressions) as well as variable declaration,
 object creation, assignment, and control flow altering keywords. <br>
 Blocks are distinguished by their context, i.e. there are separate `TokenConstants` for `if` blocks, `for` blocks, class
@@ -22,7 +22,7 @@ introduced.
 
 #### Problem in Rust (1): Grammar formulation
 
-In contrast to other grammars used in frontends, the underlying Rust ANTLR4 grammar uses very general syntactic categories 
+In contrast to other grammars used in modules, the underlying Rust ANTLR4 grammar uses very general syntactic categories 
 that do not provide very much _semantic_ information. For example, the ifExpression rule features a `blockExpression` as
 its body instead of a separate `ifBody` rule. This makes it hard to differentiate different uses of those `blockExpression`s.
 
@@ -46,7 +46,7 @@ or _etcetera_ pattern `..` is used to skip a number of elements, so that the ele
 the assigned object.
 
 These `let` pattern assignments can be replaced with a sequence of more basic assignments. This is a possible
-problem of this frontend.
+problem of this module.
 
 #### Problem in Rust (3): `return` is optional
 
@@ -66,7 +66,7 @@ fn power(base: i32, exponent: i32) -> i32 {
 }
 ```
 
-That raises the question whether to try and mark these more implicit return values, so that the output of this frontend
+That raises the question whether to try and mark these more implicit return values, so that the output of this module
 would be consistent with others.
 
 To determine all possible return values, semantic information about control structures is necessary which may be tedious
@@ -87,7 +87,7 @@ Currently, macro rule definition bodies and macro macro invocation arguments/bod
 
 ### Usage
 
-To use the Rust frontend, add the `-l rust` flag in the CLI, or use a `JPlagOption` object set
+To use the Rust module, add the `-l rust` flag in the CLI, or use a `JPlagOption` object set
 to `LanguageOption.RUST` in the Java API as described in the usage information in
 the [readme of the main project](https://github.com/jplag/JPlag#usage)
 and [in the wiki](https://github.com/jplag/JPlag/wiki/1.-How-to-Use-JPlag).

+ 1 - 1
languages/rust/src/main/java/de/jplag/rust/Language.java

@@ -8,7 +8,7 @@ import de.jplag.Token;
 public class Language implements de.jplag.Language {
 
     protected static final String[] FILE_EXTENSIONS = {".rs"};
-    public static final String NAME = "Rust frontend";
+    public static final String NAME = "Rust Language Module";
     public static final String IDENTIFIER = "rust";
     public static final int MINIMUM_TOKEN_MATCH = 8;
 

+ 2 - 2
languages/rust/src/test/java/de/jplag/rust/RustFrontendTest.java → languages/rust/src/test/java/de/jplag/rust/RustLanguageTest.java

@@ -21,7 +21,7 @@ import de.jplag.SharedTokenType;
 import de.jplag.Token;
 import de.jplag.TokenPrinter;
 
-class RustFrontendTest {
+class RustLanguageTest {
 
     /**
      * Regular expression for empty lines and single line comments.
@@ -38,7 +38,7 @@ class RustFrontendTest {
     private static final double EPSILON = 1E-6;
     public static final double BASELINE_COVERAGE = 0.75;
 
-    private final Logger logger = LoggerFactory.getLogger("Rust frontend test");
+    private final Logger logger = LoggerFactory.getLogger("Rust language test");
     private final String[] testFiles = new String[] {"deno_core_runtime.rs", COMPLETE_TEST_FILE};
     private final File testFileLocation = Path.of("src", "test", "resources", "de", "jplag", "rust").toFile();
     private Language language;

+ 8 - 8
languages/scala/README.md

@@ -1,8 +1,8 @@
-# JPlag Scala language frontend
+# JPlag Scala language module
 
-The JPlag Scala frontend allows the use of JPlag with submissions in Scala. <br>
+The JPlag Scala module allows the use of JPlag with submissions in Scala. <br>
 It is based on the [Scalameta library](https://scalameta.org/) parser, and is adapted from
-the [CodeGra-de Scala frontend](https://github.com/CodeGra-de/jplag/tree/master/jplag.frontend.scala) for JPlag, both
+the [CodeGra-de Scala module](https://github.com/CodeGra-de/jplag/tree/master/jplag.module.scala) for JPlag, both
 licensed under BSD-3.
 
 ### Scala specification compatibility
@@ -11,13 +11,13 @@ The dependencies only allow compatibility up to Scala 2.13.8 (January 2022), so
 are not supported yet.
 
 As of now, Scalameta is not available for Scala 3 yet (see the [GitHub issue](https://github.com/scalameta/scalameta/issues/2485)), 
-so the upgrade needs to wait. It would seem that once this frontend is equipped with Scalameta for Scala 3, it will be able to handle both Scala 2 and 3 equally as [the syntax is backwards compatible](https://scala-lang.org/2019/12/18/road-to-scala-3.html#:~:text=Scala%203%20is%20backwards%20compatible%20with%20Scala%202) for the most part.
+so the upgrade needs to wait. It would seem that once this module is equipped with Scalameta for Scala 3, it will be able to handle both Scala 2 and 3 equally as [the syntax is backwards compatible](https://scala-lang.org/2019/12/18/road-to-scala-3.html#:~:text=Scala%203%20is%20backwards%20compatible%20with%20Scala%202) for the most part.
 
 ### Token Extraction
 
 #### General
 
-The choice of tokens is intended to be similar to the Java or C# frontends. Specifically, among others, it includes a
+The choice of tokens is intended to be similar to the Java or C# modules. Specifically, among others, it includes a
 range of nesting structures (class and method declarations, control flow expressions) as well as variable declaration,
 object creation, assignment, and control flow altering keywords. <br>
 Blocks are distinguished by their context, i.e. there are separate `TokenTypes` for `if` blocks, `for` blocks, class
@@ -49,7 +49,7 @@ myObject.member3(arg1, arg2) // must be method call
 Operators are implemented as regular method calls. Additionally, custom operators on objects/classes can be defined,
 possibly overloading existing ones like `+`, `&=` etc.
 
-In other frontends, operations are not assigned tokens but "regular" method calls are. This calls for the task to try to
+In other modules, operations are not assigned tokens but "regular" method calls are. This calls for the task to try to
 distinguish operations from what we understand as "regular" method calls. This is not entirely possible with only
 parsing information, so we decided to go about this problem as follows:
 
@@ -74,7 +74,7 @@ def power(base: Int, exponent: Int): Int = {
     else base * power(base, exponent - 1)               // and this one?
 }
 ```
-That raises the question whether to try and mark these more implicit return values, so that the output of this frontend
+That raises the question whether to try and mark these more implicit return values, so that the output of this module
 would be consistent with others.
 
 To determine all possible return values, semantic information about control structures is necessary which may be tedious
@@ -86,7 +86,7 @@ For the moment, implicit block values are neglected.
 
 ### Usage
 
-To use the Scala frontend, add the `-l scala` flag in the CLI, or use a `JPlagOption` object set
+To use the Scala module, add the `-l scala` flag in the CLI, or use a `JPlagOption` object set
 to `LanguageOption.SCALA` in the Java API as described in the usage information in
 the [readme of the main project](https://github.com/jplag/JPlag#usage)
 and [in the wiki](https://github.com/jplag/JPlag/wiki/1.-How-to-Use-JPlag).

+ 2 - 2
languages/scala/src/test/java/de/jplag/scala/ScalaFrontendTest.java → languages/scala/src/test/java/de/jplag/scala/ScalaLanguageTest.java

@@ -22,7 +22,7 @@ import de.jplag.SharedTokenType;
 import de.jplag.Token;
 import de.jplag.TokenPrinter;
 
-class ScalaFrontendTest {
+class ScalaLanguageTest {
 
     /**
      * Test source file that is supposed to produce a complete set of tokens, i.e. all types of tokens.
@@ -45,7 +45,7 @@ class ScalaFrontendTest {
     private static final String DELIMITED_COMMENT_END = ".*\\*/\\s*$";
     private static final double EPSILON = 1E-6;
 
-    private final Logger logger = LoggerFactory.getLogger("Scala frontend test");
+    private final Logger logger = LoggerFactory.getLogger("Scala language test");
     private final String[] testFiles = new String[] {"Parser.scala", COMPLETE_TEST_FILE};
     private final File testFileLocation = Path.of("src", "test", "resources", "de", "jplag", "scala").toFile();
     private Language language;

+ 6 - 6
languages/text/src/test/java/jplag/text/TextFrontendTest.java → languages/text/src/test/java/jplag/text/TextLanguageTest.java

@@ -23,18 +23,18 @@ import de.jplag.TokenPrinter;
 import de.jplag.TokenType;
 import de.jplag.text.Language;
 
-class TextFrontendTest {
+class TextLanguageTest {
     private final Logger logger = LoggerFactory.getLogger("JPlag-Test");
 
     private static final Path BASE_PATH = Path.of("src", "test", "resources");
     private static final String TEST_SUBJECT = "FutureJavaDoc.txt";
 
-    private de.jplag.Language frontend;
+    private de.jplag.Language language;
     private File baseDirectory;
 
     @BeforeEach
     public void setUp() {
-        frontend = new Language();
+        language = new Language();
         baseDirectory = BASE_PATH.toFile();
         assertTrue(baseDirectory.exists(), "Could not find base directory!");
     }
@@ -43,7 +43,7 @@ class TextFrontendTest {
     void testParsingJavaDoc() {
         // Parse test input
         String[] input = new String[] {TEST_SUBJECT};
-        List<Token> result = frontend.parse(baseDirectory, input);
+        List<Token> result = language.parse(baseDirectory, input);
         logger.info(TokenPrinter.printTokens(result, baseDirectory));
 
         List<TokenType> tokenTypes = result.stream().map(Token::getType).toList();
@@ -56,7 +56,7 @@ class TextFrontendTest {
     void testLineBreakInputs(String input, @TempDir Path tempDir) throws IOException {
         Path file = tempDir.resolve("input.txt");
         Files.writeString(file, input);
-        List<Token> result = frontend.parse(tempDir.toFile(), new String[] {"input.txt"});
+        List<Token> result = language.parse(tempDir.toFile(), new String[] {"input.txt"});
         assertEquals(1, result.size());
     }
 
@@ -65,7 +65,7 @@ class TextFrontendTest {
     void testTokenAfterLineBreak(String input, @TempDir Path tempDir) throws IOException {
         Path file = tempDir.resolve("input.txt");
         Files.writeString(file, input);
-        List<Token> result = frontend.parse(tempDir.toFile(), new String[] {"input.txt"});
+        List<Token> result = language.parse(tempDir.toFile(), new String[] {"input.txt"});
         assertEquals(2, result.get(0).getLine());
     }