我正在尝试使用DSL并希望尝试使用Rascal。在安装Eclipse(氧气)和Rascal插件之后,我能够使用Rascal代码片段。
当尝试使用Pico语言时,我遇到的问题很少,我无法找到合适的解决方案。也许有人有一些想法。
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
以前是否有人遇到此问题,若有,有解决方法?
答案 0 :(得分:0)
如果您放置一些您尝试运行的URL或源代码示例,将会有所帮助。
我已经尝试了http://tutor.rascal-mpl.org/Recipes/Basic/Basic.html#/Recipes/Languages/Pico/Syntax/Syntax.html处的代码并使用它解析了这个代码:http://tutor.rascal-mpl.org/Recipes/Basic/Basic.html#/Recipes/Languages/Pico/Pico.html使用此代码:
procedure TForm58.FormShow(Sender: TObject);
begin
StopLoadListThread;
LListThread := TLoadListThread.Create(urlserver);
LListThread.OnLoading := LoadListThreadLoading;
LListThread.OnTerminate := LoadListThreadFinished;
LListThread.Start;
end;
procedure TForm58.StopLoadListThread;
begin
if Assigned(LListThread) then
begin
LListThread.OnLoading := nil;
LListThread.OnTerminate := nil;
LListThread.Terminate;
LListThread.WaitFor;
FreeAndNil(LListThread);
end;
end;
procedure TForm58.LoadListThreadLoading(Sender: TObject);
begin
Label1.Text := 'Loading...';
end;
procedure TForm58.LoadListThreadFinished(Sender: TObject);
var
Thread: TThread;
begin
Thread := TThread(Sender);
if Thread.FatalException = nil then
// Do something
else
// Do something else
// if using 10.1 Berlin or earlier:
TThread.CreateAnonymousThread(
procedure
begin
TThread.Queue(nil,
procedure
begin
Thread.Free;
end
);
end;
).Start;
// if using 10.2 Tokyo or later:
TThread.ForceQueue(nil,
procedure
begin
Thread.Free;
end
);
end;
procedure TForm58.CloseButtonClick(Sender: TObject);
begin
Close;
end;
procedure TForm58.FormClose(Sender: TObject; var Action: TCloseAction);
begin
StopLoadListThread;
// Do something
Action := TCloseAction.caFree;
end;
所以它似乎对我有用。你能展示一下你正在运行的代码吗?