Skip to content

Parser for Protelis, the practical aggregate programming language

License

Notifications You must be signed in to change notification settings

Protelis/Protelis-Parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Protelis-Parser

Parser for Protelis, the practical aggregate programming language

Badges

Info

Travis (.com) CII Best Practices GitHub language count GitHub top language Lines of Code GitHub code size in bytes GitHub repo size Maven Central GitHub contributors

Coverage

Codacy coverage Code Climate coverage Codecov Coverage

Quality

Codacy Badge Code Climate coverage Code Climate maintainability Code Climate maintainability Code Climate maintainability CodeFactor Quality Gate Status Bugs Code Smells Duplicated Lines (%) Maintainability Rating Reliability Rating Security Rating Technical Debt Vulnerabilities

Progress

GitHub issues GitHub closed issues GitHub pull requests GitHub closed pull requests GitHub commit activity GitHub commits since latest release (by date) GitHub last commit

What is it

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.

Contributing

Bug reports

Issues for this project are tracked together with the issues of the Protelis interpreter. Please open bug reports and feature requests there.

Development process

Create your own fork of this project, make changes, and open a pull request towards the develop branch of this project. To make sure that changes get accepted, please open a discussion first on the Protelis issue tracker, where the project maintainer may contribute.

Importing the project

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.

Troubleshooting issues with the target platform

Even though we provide a target definition that you can use You can use your own Eclipse as a target platform for developing the system, the standard target is enforced in continuous integration anyway.

You can pick the target plaform of your like from within the Eclipse preferences:

image

Generating the grammar from within Eclipse

If you make a change to the Protelis.xtext file describing the language grammar and crossreferences, you need to re-generate the parsing and linking infrastructure.

To do so, right click on the GenerateProtelis.mw2 file and run as MWE2 Workflow:

image

Launching a custom Eclipse IDE with the in-development plugin installed

If you want to quickly test your changes within an Eclipse environment, you can do so by launching the .ui project as Eclipse Application:

image

A new Eclipse IDE will pop up with your changes installed. Now: 2. In the new Eclipse application that launches and make a new Java project 125 3. Right click on the project and select: Configure > Add Xtext Nature 126 4. In the src folder, create a new file, named [something].pt (.pt means it is a Protelis file) 127 5. Write some Protelis code or hit Ctrl-space for autocompletion: you should be getting Protelis syntax evaluation and coloring

Writing tests

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.

Co-develop Protelis DSL and Protelis VM

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: 0. (optional but recommended) customize the project version. To do so, search project-wide in Eclipse for the current version, and replace it in pom.xml and MANIFEST.MF files with one of your like; 0. pull up a terminal and run mvn clean install (you must have Apache Maven installed) 0. open the Protelis interpreter project in a separate IDE; 0. change the build.gradle.kts file of the interpreter project by adding, inside the repositories block, a call to the mavenLocal() method as the first entry of the block; 0. in the versions.properties file of the interpreter project, change the parser version to the one you picked for your modified parser; 0. tell your IDE of choice for the interpreter to refresh the Gradle project import; 0. you should now be working with your custom parser!