Reputation: 1
I am experimenting with DSL and wanted to give a try with Rascal. After installation of Eclipse (oxygen) and Rascal plugin I was able to play around with Rascal code snippets.
When trying to play with the Pico language I have few problems for which I cannot find a proper solution. Maybe somebody has some ideas.
begin declare input : natural,
output : natural,
repnr : natural,
rep : natural;
input := 14;
output := 1;
while input - 1 do
rep := output;
repnr := input;
while repnr - 1 do
output := output + rep;
repnr := repnr - 1
od;
input := input - 1
od
end
Has anybody encountered this before and if so have a solution?
Upvotes: 0
Views: 194
Reputation: 6696
It would help if you put some URLs or source code examples of what you are trying to run.
I've tried the code at http://tutor.rascal-mpl.org/Recipes/Basic/Basic.html#/Recipes/Languages/Pico/Syntax/Syntax.html and parsed this with it: http://tutor.rascal-mpl.org/Recipes/Basic/Basic.html#/Recipes/Languages/Pico/Pico.html using this:
rascal>parse(#start[Program], readFile(|project://rascal-test-library/src/hello.pico|), |project://rascal-test-library/src/hello.pico|)
start[Program]: (start[Program]) `begin declare input : natural,
output : natural,
repnr : natural,
rep : natural;
input := 14;
output := 1;
while input - 1 do
rep := output;
repnr := input;
while repnr - 1 do
output := output + rep;
repnr := repnr - 1
od;
input := input - 1
od
end`
So it seems to work for me. Could you show the code that you are running?
Upvotes: 0