Skip to content
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

Statix AST property debugging #76

Open
jochembroekhoff opened this issue Sep 25, 2021 · 0 comments
Open

Statix AST property debugging #76

jochembroekhoff opened this issue Sep 25, 2021 · 0 comments

Comments

@jochembroekhoff
Copy link
Contributor

Short description
A mechanism to debug or inspect AST properties that were set to the AST after the Statix solver has finished.

Problem description
AST properties can be set by means of the constraint @astNode.prop := value (or +=).
Correspondingly, AST properties can be read using the stx-get-ast-property(|2) strategy from the Statix API for Stratego.
No other interaction with AST properties exists.
In comparison, the entire scope graph after solving can be exported in a human-readable way, in order to inspect scopes, edges and relations.

Describe the solution you'd like
A menu item in the Spoofax > Statix menu which prints the pre-analyzed AST, annotated with the solved properties (and perhaps excluding all the TermIndex annotations to reduce clutter).
Alternatively, a plain list of term indices with property name and values would be sufficient too, but less user-friendly.

Describe alternatives you've considered

  • Manually attaching a Java debugger.
  • Common debugging tactics for Statix, such as a try { false } | note $[...]@node constraint. However, AST properties are set-only, and can therefore not be retrieved in a message.

Additional context
Original Slack thread: https://slde.slack.com/archives/C7254SF60/p1632562972073600

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants