aws / aws-dax-go

AWS DAX SDK for the Go programming language. https://aws.amazon.com/dynamodb/dax
Apache License 2.0
47 stars 48 forks source link

Adding G4 grammar file for parser #55

Open alberto-salinas opened 3 months ago

alberto-salinas commented 3 months ago

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 commented 2 months ago

+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.