我知道如何在eclipse中运行rascal代码以及如何使用REPL,但是我不知道如何从命令行作为程序运行rascal文件(或rascal文件组)。
尝试以下操作时,出现解析错误:
$ java -Xmx1G -Xss32m -jar rascal-shell-stable.jar mymodule.rsc 版本:0.7.2.201501130937 从< 1,11>解析cwd:///mymodule.rsc中的错误。至< 1,12>mymodule.rsc 的内容:
module mymodule println( hello world);我在做什么错了?
解决方案好吧,您的 mymodule.rsc 实际上在语法上是不正确的,并且还会在Eclipse IDE中提供解析错误。这是一个改进的版本:
module mymodule import IO; value main(list [value] args){ println( hello world); }奖金:您还应该添加 import IO; 使 println 函数可用。
I know how to run rascal code from within eclipse and how to use the REPL, but I don't know how I can run a rascal file (or group of rascal files) as a program from the command line.
When I try the following, I get a parse error:
$ java -Xmx1G -Xss32m -jar rascal-shell-stable.jar mymodule.rsc Version: 0.7.2.201501130937 Parse error in cwd:///mymodule.rsc from <1,11> to <1,12>The contents of mymodule.rsc:
module mymodule println("hello world");What am I doing wrong?
解决方案Well, your mymodule.rsc is actually syntactically incorrect and will also give parse errors in the Eclipse IDE. Here is an improved version:
module mymodule import IO; value main(list[value] args) { println("hello world"); }Bonus: you should also add import IO; to make the println function available.
更多推荐
是否可以从命令行运行rascal程序?
发布评论