Questions tagged [rascal]

Rascal is an experimental domain specific language for metaprogramming, such as static code analysis, program transformation and implementation of domain specific languages. It includes primitives from relational calculus and term rewriting. Its syntax and semantics are based on procedural (imperative) and functional programming.

Rascal is an experimental domain specific language (DSL) for arbitrary meta-programming, such as static code analysis, program transformation and implementation of domain specific languages. It includes primitives from relational calculus and term rewriting. Its syntax and semantics are based on procedural (imperative) and functional programming. Rascal is not limited to a particular object language, rather it has generic support for manipulating all languages and targeted libraries for specific languages.

Links to more information:

455 questions
2
votes
2 answers

Can Rascal return the operating system in method?

In java I would use: System.getProperty("os.name") to get Java to return the operating system. Is something similar possible in Rascal? My goal is to write a method to write text files to a folder that works OS-independent. Something like; public…
Richard
  • 294
  • 1
  • 7
2
votes
1 answer

Get input from user with Rascal

Rascal is currently hosting my simple web server. Here I have an input for users using HTML textarea tag, and a submit button. However, I can't figure out how to request that input data from users when they have submitted it. I also don't see much…
michael
  • 45
  • 3
2
votes
1 answer

How to cite Rascal in a paper?

I'm writing a paper and want to cite Rascal. Which is the preferred paper I should cite? Or should I just cite a link to the website? There are no publications mentioned on the website. The Wikipedia entry mentions a publication from 2013 (13th…
2
votes
0 answers

Rascal : NullPointerException at createM3FromEclipseProject

The following code with Rascal will not work: module Exercise1 import IO; import IO; import lang::java::jdt::m3::Core; public void testing() { M3 model = createM3FromEclipseProject(|project://JabberPoint/|); for ( <-…
Andy
  • 21
  • 1
2
votes
1 answer

Unregistering M3 models

What is the current preferred way of unregistering M3 models from the Registry? In my project I'm using Rascal to analyse ~100 large java programs and my JVM is slowly running out of memory. I found the unregisterProject method in older versions of…
2
votes
1 answer

Finding Java Grammars

I'm making my way into Rascal - nice work! I'm halfway through the Tutor and might be getting ahead of myself, but one of my interests is refactoring Java. I've watched Tijs van der Storm's Curry On 2016 talk where he presents an example of this…
ThomasH
  • 22,276
  • 13
  • 61
  • 62
2
votes
1 answer

Resolve a physical location to a logical location

I already found the resolveLocation() function to convert a logical location to a physical location. Does there also exist a function to convert a physical location to a logical location? In that case, a location with for example "|project://...",…
2
votes
1 answer

treemap can't render box when containing text that is too large

When creating a treemap structure with boxes, boxes with a text that is larger than the box itself are not drawn. Below the same treemap is show twice: once with text, once without text. treemap with text image without text How do I prevent this…
2
votes
1 answer

Nested descendant pattern matches

I'm trying to find all method calls and the classes that contain them. If I understand correctly, pattern matches perform backtracking to match in all possible ways. Take the following java code. package main; public class Main { public static…
2
votes
1 answer

box callback functions returning the same string in Rascal

I'm trying to draw some boxes in Rascal and trying to give each box its own callback function. On entering the box with the mouse the corresponding string should get displayed in the text element (so hovering box1 should display box1 etc.). However,…
metatron
  • 896
  • 7
  • 14
2
votes
1 answer

How to solve ambiguity in an expression like new Date().getTime()?

We are working on a new version of a JavaScript grammar using Rascal. Based on the language specification (version 6) and existing JavaScript grammars, the following are valid productions for expressions: syntax Expression = ... …
2
votes
1 answer

New line as whitespace and terminator

I am parsing javascript ES6, however I can't get it to work without semicolons. I used Tin's grammar from ES5 as base , ( https://github.com/usethesource/rascal/blob/master/src/org/rascalmpl/library/lang/javascript/saner/Syntax.rsc ) and already got…
2
votes
2 answers

Unsupported scheme error when using "ls" command on a Java package

I am working on a function that gives a list of code volume per package in for a Java M3. This function looks like this: public list[int] calculateSizePerComponent(M3 model){ set[loc] packages = packages(model); list[int] componentSizes =…
Simon Baars
  • 1,877
  • 21
  • 38
2
votes
2 answers

Export a Rascal project to a JAR file

I have a Rascal project I would like to export to a JAR file to be ran like a terminal application, so users can simply run the JAR from command line instead of running it from Eclipse. Is there a way to do this? I tried to export it like a regular…
urielSilva
  • 400
  • 1
  • 11
2
votes
1 answer

CallFailed error on parse

I am a intern trying to write my first Syntax using Rascal. While programming i ran into an error that my tutor, Riemer van Rozen, had never seen before. At the moment i am still trying to see if the problem is my code or a Rascal bug but i felt…
Mauro
  • 31
  • 1