Parser for Protelis, the practical aggregate programming language
This project hosts the parsing infrastructure of the Protelis programming language, as well as its Eclipse plugin. It is a plain Xtext project. Users interested in using Protelis should most likely refer to the official Protelis website. This project is of use for Protelis developers willing to make changes to the language itself.
Issues for this project are tracked together with the issues of the Protelis interpreter. Please open bug reports and feature requests there.
Eclipse is probably the best IDE to develop this component, as it relies on the Xtext infrastructure.
- Install Eclipse
- Install the Xtext plugin from the Eclipse Marketplace
- Clone the project
- Import the project in Eclipse.
All new features or bug fixes should get appropriately tested.
To do so, there is a testing infrastructure in place.
New tests can be defined in the protelis.parser.test
project,
inside the ProtelisParsingTest.xtend
file.
The structure should be clear, and support is provided to verify that pieces of code emit warnings, throw errors, or parse correctly.
The project is built with Gradle:
- On Unix, run
./gradlew build --parallel
- On Windows, run
gradlew.bat build --parallel
In order to co-develop on the Protelis DSL and VM simultaneously, you will need to leverage the local Maven repository. Once the changes in the parser are satisfactory, proceed as follows:
- In the main
build.gradle.kts
file, enable publishing on the local Maven repository by addingmavenLocal()
to therepositories
block found insidesubprojects
; - pull up a terminal and run
./gradlew publishJavaOnMavenLocal
; - open the Protelis interpreter project in a separate IDE;
- change the
build.gradle.kts
file of the interpreter project by adding, inside therepositories
block, a call to themavenLocal()
method as the first entry of the block; - in the
gradle/libs.versions.toml
file of the interpreter project, change the parser version to the one you picked for your modified parser; - tell your IDE of choice for the interpreter to refresh the Gradle project import;
- you should now be working with your custom parser!