Pico演示失败,语法高亮和语法检查

时间:2017-10-29 08:33:09

标签: rascal pico

我正在尝试使用DSL并希望尝试使用Rascal。在安装Eclipse(氧气)和Rascal插件之后,我能够使用Rascal代码片段。

当尝试使用Pico语言时,我遇到的问题很少,我无法找到合适的解决方案。也许有人有一些想法。

问题1:当使用从流氓网站复制的示例文本(下面)时(对我来说这听起来很合适的Pico代码)。它在最后一个结束后直接给出错误。从while do块中删除代码会导致无错误

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

问题2:使用正确的微微代码,没有显示语法高亮显示;所有黑色代码。

以前是否有人遇到此问题,若有,有解决方法?

1 个答案:

答案 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;

所以它似乎对我有用。你能展示一下你正在运行的代码吗?