LFLCH / RobotDSL

A domain specific language and its support for mobile robots.
MIT License
2 stars 0 forks source link
dsl langium typescript

RobotDSL

RobotDSL is a school project (ESIR3 - Automated Software Engineering class) that aims to create a simple Domain Specific Language (DSL) for Robots.

RobotScript

Logo name

RobotScript is a programming language specialized for mobile robots.
This repository is a Langium project.
It provides a CLI as well as a WEB IDE to compile and interpret RobotScript programs.

Interpret

From a program and a given environment, the interpreter is able to calculate the state that the robot will have at each instant. It is possible to interpret a same program for several robots.

Demo squares

Compile

A RobotScript program can be translated into Arduino code using the compiler. Currently, it is specifically done for Omni4WD robots.

Robot Preview

Demonstration

Get Started

After cloning this repository, don't forget to install the dependencies.

npm install && npm run langium:generate

Resources

Documentation

The documentation/ folder contains several documentation files.

Examples

Several example files of valid RobotScript code are located in the examples/ folder. They can be used as reference to understand the language and to verify the behavior of the different implemented processes.

Main commands

Use of the CLI

Compile the necessary files

npm run build

Interpret

./bin/cli.js interpret  <filepath.rbs> 

Compile

./bin/cli.js compile  <filepath.rbs> 

Use the Web IDE

Compile the necessary files

npm run build:web

Launch the server

npm run serve

Open localhost:3001 in the browser.

Update the AST from the grammar

npm run langium:generate

Some generated files will be in the src/language/generated. You will need to place them in the src/language/representation folder. Before replacing src/language/representation/currentast.ts with the content of src/language/generated/ast.ts, please read the file comments.

VScode

The Langium project has been developped using VSCode as main IDE. We therefore coded some tools that ease the developpment.

Extension

npm run build:extension

Then install the extension that was produced.

vscode extension install

You can find it in the extensions tab of vscode. It will activate the RobotScript language support for all the .rbs files.

vscode extension overview

Launches

vscode extension run

VScode enables to automate debug processes, thanks to the Run & Debug tab. There you can select several options: