-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modeler 4.4: expression parsing [ANT-2313] (#2471)
This pull request includes several updates and improvements to the ANTLR grammar and related files for the `Expr` language. The changes involve modifications to the grammar rules, updates to the CMake configuration, and synchronization with a newer version of ANTLR. ### Grammar and Parsing Improvements: * Refactored `Expr.g4` grammar to introduce new rules and improve parsing capabilities, including the addition of `atom`, `shift_expr`, and `right_expr` rules. [[1]](diffhunk://#diff-9904320a1807a7a3514cd161403920248cbde82e6c2dbc9cf855c5c134dd62dcL20-R68) [[2]](diffhunk://#diff-9904320a1807a7a3514cd161403920248cbde82e6c2dbc9cf855c5c134dd62dcL45-L48) * Updated `Expr.tokens` to reflect new token definitions and changes in the grammar. * Removed redundant rules and tokens from `Expr.g4` and `Expr.tokens`. [[1]](diffhunk://#diff-9904320a1807a7a3514cd161403920248cbde82e6c2dbc9cf855c5c134dd62dcL45-L48) [[2]](diffhunk://#diff-cb10c1b9428e9e48c48e524757dfc48dcc6ae8dd2ad921eff65851cbc3c2e5c1L10-R30) ### Build Configuration Updates: * Updated `sonar-project.properties` to exclude `src/libs/antares/antlr-interface` from Sonar analysis. antlr-interface contains generated code that trigger defect in analysis * Modified `CMakeLists.txt` to always include the `antlr-interface` directory and removed conditional logic for building with ANTLR4. [[1]](diffhunk://#diff-148715d6ea0c0ea0a346af3f6bd610d010d490eca35ac6a9b408748f7ca9e3f4L186-L188) [[2]](diffhunk://#diff-148715d6ea0c0ea0a346af3f6bd610d010d490eca35ac6a9b408748f7ca9e3f4R194-R195) [[3]](diffhunk://#diff-9e299f60c14464c86511d6c9a4e7c081765abb4840b57ea4dc25238311006ce9L31-L33) ### Synchronization with ANTLR 4.13.2: * Updated generated files to be compatible with ANTLR 4.13.2, including `ExprBaseVisitor.cpp`, `ExprBaseVisitor.h`, and `ExprLexer.cpp`. [[1]](diffhunk://#diff-bda2e00a884ff4b113d535c8239b493bfc88c5c4f1d38c4687c2f28e44cdfde8L2-R2) [[2]](diffhunk://#diff-abcc97c1794721be0f33a540339645ac1d5d9d3dd6cbe941235200bad3dcacb9L2-R2) [[3]](diffhunk://#diff-6adabe5fce15f2c6367db67aa33a2e02bb220796c9ff4e143160752a637ca3c0L2-R2) * Adjusted `ExprLexer.cpp` to use `std::unique_ptr` for static data initialization. [[1]](diffhunk://#diff-6adabe5fce15f2c6367db67aa33a2e02bb220796c9ff4e143160752a637ca3c0L48-R48) [[2]](diffhunk://#diff-6adabe5fce15f2c6367db67aa33a2e02bb220796c9ff4e143160752a637ca3c0L61-R62) ### Visitor Pattern Enhancements: * Updated `ExprBaseVisitor` to include new visit methods for the added grammar rules. [[1]](diffhunk://#diff-abcc97c1794721be0f33a540339645ac1d5d9d3dd6cbe941235200bad3dcacb9L22-R57) [[2]](diffhunk://#diff-abcc97c1794721be0f33a540339645ac1d5d9d3dd6cbe941235200bad3dcacb9L58-R106) These changes collectively enhance the flexibility and maintainability of the grammar and build configuration, while ensuring compatibility with the latest ANTLR version. --------- Co-authored-by: Abdoulbari Zaher <[email protected]> Co-authored-by: Florian OMNES <[email protected]> Co-authored-by: Florian OMNES <[email protected]>
- Loading branch information
1 parent
427c395
commit 0d9e6d4
Showing
46 changed files
with
2,068 additions
and
825 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.