Git Product home page Git Product logo

dsl's Introduction

Labs on Domain-Specific Languages (DSL)

Author

Charly REUX

Summary

This repository is the implementation of the dsl lab course that can be found here. The goal of this project was to follow a tutorial composed of three parts:

  • Domain modeling: definition of the Ecore metamodel for your language
  • Textual modeling: definition of the Xtext editor for your language
  • Executable modeling

Part 3 - Executable modeling

In this part, we had to create two things:

  • A compiler from the language that we had defined earlier to java, which had to be implemented in the visitor pattern and implement a state pattern. Following our course on dsl,
    I used the Xtend's extension methods to go throught the abstract tree and create the java code from it. The reason for that, is that using a real visitor pattern may end up overflowing the stack because of non-stopping calls between the visitor and the element.
  • An interpreter, which uses the @Aspect annotation to modify the abstract tree dynamically.

Here is the architecture that I opted for for my simplified visitor pattern:

This architecture makes it easier to create new compilers or new interpreter, as we can see on this diagram I made two concrete classes, one which is used to compile into java, and another which is used to interpret our source language.

Sirius

On my own I tried using sirius, I managed to create a graphical interface to create state and to show the init state but I got stuck while trying to create transitions. This is mainly due to my metamodel which is overly simplified and this could be archieved by modifying it and adding a binding from the states to the fsm.

dsl's People

Contributors

charlyreux avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.