Directory structure migration (March 2016)¶
To clean up the structure of a language specification project, we've made the following changes:
- ESV
- Main ESV file must be at
editor/Main.esv
. If it does not exist, no packed ESV file will be generated. - Packed ESV file:
target/metaborg/editor.esv.af
- Main ESV file must be at
- SDF
- The RTG and signatures files are no longer generated for SDF3 projects, since SDF3 generates its own signatures.
- The generated box pp files are no longer generated, and box pp files are no longer converted into pp.af files.
- Definition:
src-gen/syntax/[LanguageName].def
- Permissive definition:
src-gen/syntax/[LanguageName]-permissive.def
- Parenthesizer:
src-gen/pp/[LanguageName]-parenthesize.str
- Parse table:
target/metaborg/sdf.tbl
- Stratego
- 'editor-common.generated' file:
src-gen/stratego/metaborg.str
- Ctree:
target/metaborg/stratego.ctree
- Generated Java files:
src-gen/stratego-java
- JAR:
target/metaborg/stratego.jar
- Java strategies:
src/main/strategies
- Java strategies JAR:
target/metaborg/stratego-javastrat.jar
- Build cache:
target/stratego-cache
- 'editor-common.generated' file:
- DynSem
- Manual Java:
src/main/ds
- Generated Java:
src-gen/ds-java
- Manual Java:
- Other
- Pluto build cache:
target/pluto
- Pluto build cache:
To migrate your project, make the following changes:
- Change the file name of the main ESV file to
Main.esv
, and change its module toMain
. - In the main ESV file:
- Change the parse table:
table : target/metaborg/sdf.tbl
- Change the Stratego providers
- For ctree projects:
provider : target/metaborg/stratego.ctree
- For jar projects:
provider : target/metaborg/stratego.jar
- For projects with Java strategies:
esv provider : target/metaborg/stratego.jar provider : target/metaborg/stratego-javastrat.jar
- For ctree projects:
- Change the parse table:
- In all Stratego, NaBL, TS files
- Instead of importing
lib/editor-common.generated
, importstratego/metaborg
. - Instead of importing
include/<langname>-parenthesize
, importpp/<langname>-parenthesize
. - If you're using SDF3:
- Instead of importing the signatures from
include/<langname>
, import them fromsignatures/<langname>-sig
. These signatures are spread over multiple files, import all the required files to fix errors, since the Stratego editor does not handle transitive imports. You can also use the wildcard importsignatures/-
to import all signature files, if your syntax definition is not spread over multiple directories.
- Instead of importing the signatures from
- If you're using SDF2 or an external definition file:
- Instead of importing the signatures from
include/<langname>
, import them fromsignatures/<langname>
.
- Instead of importing the signatures from
- Instead of importing
- If your project has Java strategies:
- Create the
src/main/strategies
directory. - Move Java strategies from
editor/java
into thesrc/main/strategies
directory. Be sure to preserve the existing Java package structure.
- Create the
- If your project has manual DynSem Java files:
- Create the
src/main/ds
directory. - Move manual DynSem Java files from
editor/java
into thesrc/main/ds
directory. Be sure to preserve the existing Java package structure.
- Create the
- Perform a Maven update by right clicking the project and choosing Maven ‣ Update Project.... Enable Force Update of Snapshots/Releases in the new window and press Ok. This updates the Java source directories of the project.
- If you are still using SDF2 instead of SDF3, add the following setting to the
metaborg.yaml
file:language: sdf: version: sdf2
Last update:
October 17, 2024
Created: October 17, 2024
Created: October 17, 2024