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

Add support for Spoofax Core transformations in DynSem interpreters #147

Open
vvergu opened this issue Dec 6, 2016 · 1 comment
Open

Comments

@vvergu
Copy link
Member

vvergu commented Dec 6, 2016

An old bug in Graal VM which prevented us from loading Spoofax Core in a Graal VM seems to have been fixed. It should now become possible to call Spoofax (Stratego) transformations from DynSem interpreters. This is useful e.g. to desugar an object language program before interpretation.

@hendrikvanantwerpen
Copy link
Contributor

For the scopgraph-frame connection, I have created a runner that wraps the language entry point and calls Spoofax parsing, desugaring, and analysis before running the interpreter on the analyzed AST. Since I'm not sure you know this exists, I'll explain how it currently works:

There is a generic DynSemRunner, which calls the regular Spoofax Core pipeline of parsing, desugaring, analysis, before running the interpreter. It is subclasses per language (e.g., PCFRunner). I use is as a (almost) drop-in replacement for directly calling the EntryPoint.

It uses the SPOOFAXPATH environment variable, which I set in the .launch file to the workspace path, to search for the language to load. This way there is no need to copy parse tables, and language rebuilds are effective in the interpreter as well (for syntax and analysis, that is). Maybe this way is a bit arcane, and a mechanism with real dependencies (like #148) is nicer here.

I've tried to run this on Graal VM a while back, and it worked then. Maybe this can be unified with the entry point, to get rid of custom parsing and desugaring steps, and always have the full Spoofax Core pipeline before execution?

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