0

I developed a code generator in Rascal and I want to integrate it with a tool developed in Java. I tried to generate a jar file for the Rascal project with eclipse to put into the Java project, but it just puts the Rascal files of the project into the jar. I searched into Rascal Tutor and here, but I didn't find nothing about it.

Someone knows how I can do this?

1 Answers1

0

As of yet, this scenario is not that straightforward (also see discussion in github issue #57). In principle, it is possible to call Rascal from java, but you would have to construct the Evaluator and import modules and call functions, and do the translation from our IValues to your java data type.

For inspiration on how to initialize an Evaluator: https://github.com/cwi-swat/rascal-shell/blob/master/src/org/rascalmpl/shell/RascalShell.java

The other way around, might work more easily. It is easy to call a Java method in Rascal and adding your own menu option in a Java editor is also straightforward.

Davy Landman
  • 15,109
  • 6
  • 49
  • 73