-
Notifications
You must be signed in to change notification settings - Fork 132
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
addition of a abstract syntax tree to source code printer #1113
base: master
Are you sure you want to change the base?
Conversation
…ble to make a subclass using this class see exampleDiagnostic.py
…ree in python. The syntaxFactory bindings do not work yet.
…their parameters is supported
…names are written
…done this way because the information needed to remake the source code (the genvar expresion, itteration,....) are not present in the ast.I added more binary operators and made cosmetic changes to InstanceBody
…ow possible to make a subclass using this class see exampleDiagnostic.py" This reverts commit c646605.
…nto astPrinterRelease
… to making it compatible with the changes in the ast
Thanks for submitting a PR. Please get the tests and pre-commit checks to pass and revert any changes that aren't required to be part of this diff, such as the changes to the build workflow. Also from a higher level point of view I'm not against adding a printer for the AST but I'm curious what your use case is and whether the printer really needs to live in the slang library or could just exist in a downstream application. |
his pull request introduces the initial implementation of an AST to Source Code Printer as part of a recent internship project. The goal of this addition is to enable the conversion of AST representations back into human-readable source code. Currently, the functionality is limited to handling simple programs, more complex programs may not be accurately represented yet. The current version lacks support for 'property', 'checker', 'cover', and 'generate' statements, although it does provide basic support for other elements .
changes to the orginal AST are the addition of a 'name' member to the CovergroupType and corresponding updates to the JSON AST printer. A 'isDuplicate' flag has been introduced to VariableFlags to track duplicate information. Furthermore, a 'MinimalInfoEnabled' option has been added to the serializer, producing a JSON output with reduced information, facilitating the comparison of different ASTs for equivalence.
A test suite based on the 'all.sv' file has been made. Programs are validated by running the AST printer and comparing the resulting AST of the generated source code against the original code's AST. This comparison is made through the json representation.
(The workflow currently fails but i am currently developing a fix for this)