You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mpivet-p opened this issue
Feb 21, 2024
· 1 comment
Assignees
Labels
bugIssue/PR that involves a buglanguagePR / Issue deals (partly) with new and/or existing languages for JPlagminorMinor issue/feature/contribution/change
I have the following error when running JPlag on a C file using the cpp2 language parameter:
$> java -jar ~/Downloads/jplag-4.3.0-jar-with-dependencies.jar -l cpp2 check
2024-02-21-06:24:37_092 [main] [INFO] LanguageLoader - Available languages: '[C/C++ Scanner [basic markup], C/C++ Parser, C# 6 Parser, EMF metamodel, Go Parser, Javac based AST plugin, Kotlin Parser, Python3 Parser, R Parser, Rust Language Module, Scala parser, SchemeR4RS Parser [basic markup], Swift Parser, Text Parser (naive)]'
2024-02-21-06:24:37_102 [main] [INFO] ParallelComparisonStrategy - Start comparing...
line 3:27 no viable alternative at input 'va_arg(arg,unsignedint)'
line 3:30 mismatched input ''c'' expecting {'decltype', 'operator', '(', '*', '&', '~', AndAnd, '::', '...', Identifier}
line 3:33 extraneous input ')' expecting ';'
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "java.util.List.iterator()" because "next.children" is null
at de.jplag.cpp2.CPPTokenListener.getDescendant(CPPTokenListener.java:375)
at de.jplag.cpp2.CPPTokenListener.enterSimpleDeclaration(CPPTokenListener.java:326)
at de.jplag.cpp2.grammar.CPP14Parser$SimpleDeclarationContext.enterRule(CPP14Parser.java:5639)
at org.antlr.v4.runtime.tree.ParseTreeWalker.enterRule(ParseTreeWalker.java:50)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:33)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
at de.jplag.cpp2.CPPParserAdapter.scan(CPPParserAdapter.java:46)
at de.jplag.cpp2.CPPLanguage.parse(CPPLanguage.java:48)
at de.jplag.Submission.parse(Submission.java:249)
at de.jplag.SubmissionSet.parseSubmissions(SubmissionSet.java:147)
at de.jplag.SubmissionSet.parseAllSubmissions(SubmissionSet.java:103)
at de.jplag.SubmissionSet.<init>(SubmissionSet.java:45)
at de.jplag.SubmissionSetBuilder.buildSubmissionSet(SubmissionSetBuilder.java:78)
at de.jplag.JPlag.run(JPlag.java:55)
at de.jplag.cli.CLI.main(CLI.java:91)
Running it with cpp1 works just fine and doesn't throw any error.
I am running JPlag on a macbook pro m2 with the following version:
$> java -version
openjdk version "21.0.2" 2024-01-16
OpenJDK Runtime Environment Homebrew (build 21.0.2)
OpenJDK 64-Bit Server VM Homebrew (build 21.0.2, mixed mode, sharing)
The text was updated successfully, but these errors were encountered:
tsaglam
added
bug
Issue/PR that involves a bug
minor
Minor issue/feature/contribution/change
language
PR / Issue deals (partly) with new and/or existing languages for JPlag
labels
Feb 21, 2024
This is a case that probably will never be supported by JPlag.
As far as I can tell va_arg is a macro. Macros are't supported by JPlag, as the ANTLR grammar has no support for them. In general you could get around that by evaluating macros first, then calling JPlag. In this specific case, I think the result of the macro is still a special case that doesn't fit the grammar.
If you know a way to support this case in the grammar, feel free to open a PR or an issue in the ANTLR repository.
The cases that are working are doing so only by chance, the resulting AST is still incorrect.
bugIssue/PR that involves a buglanguagePR / Issue deals (partly) with new and/or existing languages for JPlagminorMinor issue/feature/contribution/change
I have the following error when running JPlag on a C file using the cpp2 language parameter:
Running it with cpp1 works just fine and doesn't throw any error.
I am running JPlag on a macbook pro m2 with the following version:
These C files are triggering the same error:
1)
But this one works without any issue:
The text was updated successfully, but these errors were encountered: