Giter Site home page Giter Site logo

comp-js's Introduction

COMP-JS

Ceci est le README du projet. Il faut y mettre toutes les infos concernant l'installation et l'utilisation du Compilateur. Feel free to add more ;)

COMMENT UTILISER GIT

Pour ceux qui ont du mal avec GIT, tuto pour l'utiliser en lignes de commandes, je connais pas les interfaces et utilitaires.

Pour télécharger le projet dans un premier temps : git clone https://github.com/AcidBaz/COMP-JS.git cela va créér le dossier de projet.

Avant de faire des modifs, vérifiez que vous êtes à jour avec la branche principale, master avec : git status

si vous ne l'êtes pas : git pull

Une fois vos modifications terminées : git status pour voir les modifs.

Si vous avez créé des nouveaux fichiers il faut les ajouter avec : git add "fichier"

Si vous en avez supprimé : git rm "fichier"

Ensuite il faut commit vos changements avec un petit message explicatif : git commit -m "votre message"

Enfin, il faut push sur le repertoire en ligne afin que tout le monde puisse accèder à vos modifs ( NE JAMAIS PUSH SANS ETRE A JOUR ) : git push

Voila =) Ask Basile ou Antoine si besoin.

Installation du projet Xtext sur Eclipse

Pour installer le projet correctement : Télécharger Eclipse et le plugin xtext. Créer un nouveau projet xtext appelé "org.xtext.example.projet", avec comme extension ".wh" alt text

Ensuite, il faut importer les fichiers donnés sur le github :

GenerateProjet.mwe2 : dans org.xtext.example.projet -> src -> org.xtext.example
Projet.xtext : dans org.xtext.example.projet -> src -> org.xtext.example
Ensuite, faire "generate artifacts" sur Projet.xtext.
Main.java : dans org.xtext.example.projet -> src -> org.xtext.example.generator
ProjetGenerator.xtend : dans org.xtext.example.projet -> src -> org.xtext.example.generator

Le fichier Projet.xtext contient la grammaire que l'on souhaite utiliser. Le fichier GenerateProject.mwe2 n'est pratiquement pas modifié : on ajotue les lignes "generator = {generateJavaMain = true}" afin d'avoir un fichier "Main.java".
Ensuite, on modifie "Main.java" afin d'avoir un parser plus complet.
Après avoir run le main une fois, on peut exporter le projet "org.xtext.example.projet" en .jar avec clic droit -> export -> Runnable JAR File
alt text

Ce jar peut ensuite être utilisé comme parser :

alt text

Sont également disponibles sur le repo le runnable JAR "projet.jar", et les deux fichiers "right.wh" et "wrong.wh" qui sont respectivement corrects et incorrects afin de pouvoir les tester.

Utiliser le pretty printer

Une fois après avoir ajouté le fichier ProjetGenerator.xtend, on peut pretty-printer des fichiers dans l'interface Eclipse.
Il faut faire clic-droit sur Projet.xtext -> generate artifacts,
Puis clic-droit sur org.xtext.example.projet -> Run As -> Eclipse application.

On se retrouve face à cette interface : alt text

Il faut créer un nouveau projet :
alt text

Et dans src, ajouter un fichier .wh
Normalement, Eclipse vous demandera de convertir le projet en projet xtext :
alt text

Ensuite, il faut copier dans ce fichier le contenu de test_PP.wh (voir test/test_PP.wh) : alt text

Enfin, pour appliquer le pretty printer, il suffit de sauvegarder ce fichier avec ctrl+s. Cela génère un dossier src-gen qui contient toutes les fonctions dans components/ et le fichier pretty-printer dans file.whp : alt text

comp-js's People

Contributors

emmanueljego avatar faustineg avatar b-chiquet avatar falcoff avatar agautrain avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

agautrain

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.