Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a PR to address #199 The overall idea is to use a trait to generate the grammer for statements and leave the overall parsing rules for
Region
andBlock
hardcoded into the grammer along with some other rules regarding things like ssa identifiers block identifiers comments, etc. The grammer is collected from a dialect group merging all the rules together coming from the traits of individual statements and attributes inside the dialect group and compiled into a Lark Grammer. The rules form a registry, making an individual rule to an IR node.The final grammar is then used to parse a string given an entry point statement: func. Function, Module, etc. After that, the Lark tree will be visited and lowered using the Lowering framework to generate the IR. The registry of lark rules is used by the lowering infrastructure to dispatch the lark tree labels to the specific statements and attributes.