Skip to content

Latest commit

 

History

History
35 lines (21 loc) · 1.83 KB

README.md

File metadata and controls

35 lines (21 loc) · 1.83 KB

JPlag C++ language module

Note: This replaces the old cpp module, which is now only meant for c, as it works better for c than this one.

The JPlag C++ frontend allows the use of JPlag with submissions in C++.
It is based on the C++ ANTLR4 grammar, licensed under MIT.

C++ specification compatibility

The grammar definition targets C++14.

If the grammar is updated to a more recent1 syntax definition, this module should surely be updated as well.

Token Extraction

The choice of tokens is intended to be similar to the Java language module. While the Java language module is based on an AST, this language module uses a parse tree only. There are differences, including:

  • import is extracted in Java, while using is not extracted due to the fact that it can be placed freely in the code.

More syntactic elements of C++ may turn out to be helpful to include in the future, especially those that are newly introduced.

Usage

To use the C++ frontend, add the -l cpp flag in the CLI, or use a JPlagOption object with new de.jplag.cpp.CPPLanguage() as Language in the Java API as described in the usage information in the readme of the main project and in the wiki.

Changes to the Grammar

There is one change in our grammar compared to the original one. In the rule for "theOperator" 'DivAssign' was added as a case. This is an error in the original version.


Footnotes

1 The grammar files are taken from grammar-v4, with the most recent modifications in commit 6e10f7e from May 2021.