Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding G4 grammar file for parser #55

Open
alberto-salinas opened this issue Apr 1, 2024 · 1 comment
Open

Adding G4 grammar file for parser #55

alberto-salinas opened this issue Apr 1, 2024 · 1 comment

Comments

@alberto-salinas
Copy link

I'd like to propose including the ANTLR grammar file (.g4) along with the generated source files in our version control system. This inclusion offers several benefits that can significantly improve the project's clarity, maintainability, and collaborative potential. Here are the key advantages:

Improved Project Understanding: The grammar file serves as a high-level description of the language or data format that our project parses or generates. By including it in the repository, new contributors can quickly grasp the structure and rules of the language without diving deep into the generated code, which might be more complex and less human-readable.

Easier Updates and Maintenance: When the grammar needs to be modified or extended, having the .g4 file readily available in the repository allows contributors to make changes directly and regenerate the source files. This ensures that updates can be made efficiently, and the generated code remains consistent with the grammar definition.

Better Version Control: Tracking changes to the grammar file over time provides a clear history of the language's evolution or the data format within the project. This historical context is invaluable for understanding why certain decisions were made and can help in diagnosing issues or planning future extensions.

Enhanced Collaboration: Including the grammar file facilitates collaboration among team members and contributors who might be working on extending the language or integrating new features. It ensures that everyone has access to the most current version of the grammar, reducing the likelihood of conflicts or inconsistencies.

Quality Assurance: The presence of the grammar file in the repository allows for the application of quality assurance processes, such as peer reviews of grammar changes, before they affect the generated code. This can lead to a more robust and error-free codebase by catching potential issues at the grammar level.

@oaustin-sq
Copy link

+1 to this. The current antlr version used is more than 5 years old. Our repo already uses a newer version of antlr, and since antlr doesn't follow semver semantics, the versions are incompatible. This has made the client as a whole unusable for us. Ideally we would request the antlr version to be bumped and grammar regenerated, but even just including the source files with the client would empower us to regenerate things with the newer antlr version on our own fork of this client.

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

No branches or pull requests

2 participants