A VM using the scopes as frames paradigm described by Poulsen et al.
For an overview of available instructions, see the docs
folder.
Before importing the project in eclips, you have to run the Maven install script. You can either do this for all projects in a single go by executing the build.sh
-script, or by executing mvn install
in each package individually. You have to do this for at least framevm-core
and framevm
(in this order), in order to have a working project setup.
After this you can import the project in Eclipse using File -> Import -> Maven -> Existing Maven projects
. After importing you might have to manually trigger a Spoofax build using Project -> Build all
.
Include the following in your projects pom.xml
:
<dependencies>
<dependency>
<groupId>org.metaborg.lang</groupId>
<artifactId>framevm</artifactId>
<version>1.1.0</version>
<type>spoofax-language</type>
</dependency>
</dependencies>
Include the following in your metaborg.yaml
:
dependencies:
source:
- org.metaborg.lang:framevm:1.1.0
The following files contain the definitions you might want to use when compiling to Stacy:
signatures/fvm-stacy-sig
: Signatures of Stacy constructssignatures/fvm-common-sig
: Signatures of the Frame VMfvm-common
: Common (desugared) constructors and usefull functions when operating on Stacy ASTs:pp-framevm-stacy
: Pretty-print a Stacy ASTeval-framevm-stacy
: Run a Stacy AST (Note: for this to work you need to copy over the java strategies and register them)eval-framevm-stacy-debug
: Run a Stacy AST (Note: for this to work you need to copy over the java strategies and register them)
fvm-util
: Helper functions when compiling to Stacy. See thedocs
folder for a more detailed descriptionstc-from-flat
: Build a valid Stacy AST from a list of instructionsrgr-from-flat
: Build a valid Roger AST from a list of instructionsframevm-path-from-nabl2
: Get an access path from an Nabl2 reference
If you need other strategies from other files, please notify me such that I can add them to these files. This as any other file might change in the future.
Stacy includes a number of functions in a library like string concatenation and string printing.
To make use of this library, you have to make the files visible to importing files. There are two ways to do this: The first is to simply copy over the stdlib
folder from framevm.lib
to the root of your project that contains the Stacy programs. This method is not encouraged as you need to manually update the library when it is updated. You might notice that making a symlink fixes this issue, sadly these don't work nicely in combination with Eclipse. The second solution is to select your project in Eclipse, add a Spoofax nature (right click -> Spoofax-meta -> add Spoofax nature), open its properties (project -> properties), navigate to the 'Java build path' page and click link source
. In the dialog, select the framevm.lib/stdlib
-folder and give it the name 'stdlib'. On this same page you might see src
as an other linked source, this one must be removed. Stacy programs now should be able to import functions from the library.