Open olivernybroe opened 1 year ago
I'm experiencing the same issue, not sure why this one is closed
This issue was closed by the original poster. If this issue persists, it may be a problem with the underlying ANTLR grammar we are using.
This feature seems to have been introduces in C# 7. JPlag currently only supports C# 6. The antlr grammar repository doesn't contain a newer version either. You are welcome to update the grammar.
Given the following code
it results in a complete crash
Stacktrace
``` 2023-05-02-03:45:16_789 [main] [INFO] LanguageLoader - Available languages: '[C/C++ Scanner [basic markup], 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)]' line 5:12 mismatched input '=' expecting '{' Exception in thread "main" java.lang.ClassCastException: class de.jplag.csharp.grammar.CSharpParser$Namespace_or_type_nameContext cannot be cast to class de.jplag.csharp.grammar.CSharpParser$Local_variable_declarationContext (de.jplag.csharp.grammar.CSharpParser$Namespace_or_type_nameContext and de.jplag.csharp.grammar.CSharpParser$Local_variable_declarationContext are in unnamed module of loader 'app') at de.jplag.csharp.grammar.CSharpParserBase.isLocalVariableDeclaration(CSharpParserBase.java:19) at de.jplag.csharp.grammar.CSharpParser.local_variable_declaration_sempred(CSharpParser.java:19486) at de.jplag.csharp.grammar.CSharpParser.sempred(CSharpParser.java:19473) at org.antlr.v4.runtime.atn.SemanticContext$Predicate.eval(SemanticContext.java:101) at org.antlr.v4.runtime.atn.ParserATNSimulator.evalSemanticContext(ParserATNSimulator.java:1433) at org.antlr.v4.runtime.atn.ParserATNSimulator.splitAccordingToSemanticValidity(ParserATNSimulator.java:1349) at org.antlr.v4.runtime.atn.ParserATNSimulator.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(ParserATNSimulator.java:1304) at org.antlr.v4.runtime.atn.ParserATNSimulator.execATN(ParserATNSimulator.java:472) at org.antlr.v4.runtime.atn.ParserATNSimulator.adaptivePredict(ParserATNSimulator.java:396) at de.jplag.csharp.grammar.CSharpParser.namespace_or_type_name(CSharpParser.java:518) at de.jplag.csharp.grammar.CSharpParser.class_type(CSharpParser.java:1160) at de.jplag.csharp.grammar.CSharpParser.base_type(CSharpParser.java:724) at de.jplag.csharp.grammar.CSharpParser.type_(CSharpParser.java:587) at de.jplag.csharp.grammar.CSharpParser.typed_member_declaration(CSharpParser.java:12356) at de.jplag.csharp.grammar.CSharpParser.common_member_declaration(CSharpParser.java:12179) at de.jplag.csharp.grammar.CSharpParser.class_member_declaration(CSharpParser.java:11952) at de.jplag.csharp.grammar.CSharpParser.class_member_declarations(CSharpParser.java:11815) at de.jplag.csharp.grammar.CSharpParser.class_body(CSharpParser.java:11760) at de.jplag.csharp.grammar.CSharpParser.class_definition(CSharpParser.java:17960) at de.jplag.csharp.grammar.CSharpParser.type_declaration(CSharpParser.java:10939) at de.jplag.csharp.grammar.CSharpParser.namespace_member_declaration(CSharpParser.java:10851) at de.jplag.csharp.grammar.CSharpParser.namespace_member_declarations(CSharpParser.java:10769) at de.jplag.csharp.grammar.CSharpParser.compilation_unit(CSharpParser.java:418) at de.jplag.csharp.CSharpParserAdapter.parseFile(CSharpParserAdapter.java:63) at de.jplag.csharp.CSharpParserAdapter.parse(CSharpParserAdapter.java:47) at de.jplag.csharp.Language.parse(Language.java:51) 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.(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)
```