Skip to content

Add Support for Lambda, Comments, Generics, and For-Each to Java Grammar#216

Merged
shubhamugare merged 1 commit intostructuredllm:mainfrom
pdfCN:fix/java_parser
Jul 15, 2025
Merged

Add Support for Lambda, Comments, Generics, and For-Each to Java Grammar#216
shubhamugare merged 1 commit intostructuredllm:mainfrom
pdfCN:fix/java_parser

Conversation

@pdfCN
Copy link
Copy Markdown
Contributor

@pdfCN pdfCN commented Jul 15, 2025

This PR significantly enhances the Java grammar by adding support for essential language features that were previously missing:

✅ Added Features:

  • Lambda expressions: (a, b) -> a + b
  • Java comments: // line and /* block */
  • Generics: List<String>, Map<K, ? extends V>, Set<?>, etc.
  • For-each loops: for (int i : list)

📊 Evaluation:

  • Model: Qwen/Qwen2.5-Coder-1.5B (Greedy)
  • Benchmark: HumanEval-x (Java version)
Version Pass@1
wo/ syncode (Original Model) 42.7%
w/ syncode (Original Parser) 28.0%
w/ syncode (Update parser) 45.7%

🔍 Notes:

This improvement addresses key syntax limitations in the original grammar, enabling more accurate code generation and parsing for Java. It directly contributes to better performance on HumanEval-x and closes gaps in practical code scenarios.

@shubhamugare
Copy link
Copy Markdown
Collaborator

Perfect! Thanks for the PR

@shubhamugare shubhamugare merged commit 270a7b0 into structuredllm:main Jul 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants