-
Notifications
You must be signed in to change notification settings - Fork 139
Initial implementation of AST for CQL #1640
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
base: master
Are you sure you want to change the base?
Conversation
…e branch) (#1637) Fixes for AST classes. Add parse tree and AST inspectors.
|
Formatting check succeeded! |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1640 +/- ##
============================================
- Coverage 65.88% 65.61% -0.27%
Complexity 1645 1645
============================================
Files 477 479 +2
Lines 27505 27617 +112
Branches 5471 5495 +24
============================================
Hits 18121 18121
- Misses 7084 7196 +112
Partials 2300 2300 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I don't have any comments on the code (haven't looked at it), but I'm curious -- what's the motivation/vision for this CQL AST? |
The ultimate goal is to split the compiler into a frontend (parsing, AST generation, type inference, some types of optimization like inlining) and a backend (ELM generation). The motivations for that are multi-fold.
|
Thanks for additional insight. That's helpful. It's been a while since I've written any significant CQL-to-ELM code (probably nearing a decade). I didn't realize the ELM model itself caused so much complexity -- I assumed it was mainly the type inference, function resolution, and other various CQL magic, but it sounds like that stuff is just shifting to the AST generator now. That said, ELM was based on Health e-Decisions, so I shouldn't be surprised that conforming to that schema might introduce additional complications. There's not much to argue with here: better separation of concerns, better testing, better consistency across versions, better IDE tools, and easier translation into other target formats. I like it. One small note: I wanted to see what the AST looks like, so I built it and ran the CQL playground. In the process of doing that, I found that the CQL-to-ELM UI README needs to be updated. It currently says to browse to http://localhost:3000/cql-to-elm-ui, but that should be http://localhost:3000/clinical_quality_language/playground now. |
|
Hi @cmoesel, sorry the README got outdated after we deployed the UI to cqframework.org. Now it's fixed. |
Is that "I like the idea" or "I like the AST implementation?" |
I like the idea. I haven't looked at the implementation closely enough to comment on that. Is there any documentation that lists all of the possible AST nodes and their relationships? |
|
|
@cmoesel - Docs updated. A few key ones: |
|


SystemModelInfoProvider.FilesToStringsTaskGradle task with codegen enabling file contents to be inlined at compile time and used as strings (useful for e.g. inliningsystem-modelinfo.xmlforSystemModelInfoProvider-in-JS).LoadTestResourcesTaskGradle task with multiplatform codegen enabling access to test resources in commonTest.