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.
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.
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, whileusing
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.
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.
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.