Skip to content

Conversation

@chinyeungli
Copy link
Contributor

Screenshot 2025-10-29 113847

Support mapping .class to their corresponding grammar definitions (.g / .g4) files.

Note that grammar files are not exclusive to Java; they can also be used for Python, C++, PHP, and other languages.
This PR focuses solely on .class mapping.
Further enhancements can be made over time.

def find_grammar_packages(self):
"""Find the java package of the .g/.g4 source files."""
d2d.find_jvm_packages(
project=self.project, jvm_lang=jvm.GrammarLanguage, logger=self.log
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is GrammarLanguage a JVM based language?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not exactly, but it follows the same basename mapping logic in the Java case.
To make its purpose clearer, perhaps we could rename it to find_grammar_java_packages()?

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.

3 participants