2017-10-29 1 views
0

DSL로 실험 중이며 Rascal에서 시도해보고 싶습니다. Eclipse (산소)와 Rascal 플러그인을 설치 한 후에 나는 Rascal 코드 스 니펫으로 놀 수있었습니다.구문 강조 및 구문 검사로 Pico 데모가 실패합니다.

피코 언어로 게임을 할 때 적절한 해결책을 찾을 수없는 몇 가지 문제가 있습니다. 어쩌면 누군가가 어떤 생각을 가지고 있을지도 모른다.

문제 1 : 불량배 웹 사이트에서 복사 한 예제 텍스트 (아래)를 사용할 때 (필자에게 이것은 적절한 피코 코드로 들린다). 그것은 마지막 닫는 끝 직후에 오류를줍니다. 그동안 코드로부터 분리 블록 결과없는 오류

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 수행 도시 하이라이팅 신택스 없다 피코 적절한 코드를; 모두 검은 색 코드.

아무에게도이 문제가 발생 했나요? 그렇다면 해결책이 있습니까?

답변

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이를 사용하여 :

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` 

그래서 나를 위해 작동하는 것 같다. 실행중인 코드를 표시 할 수 있습니까?

+0

나는 Rascal 튜토리얼 웹 사이트에서 소스 코드를 얻었습니다. http://tutor.rascal-mpl.org/Recipes/Basic/Basic.html#/Recipes/Languages/Pico/Pico.html –

+0

또한 유감스럽게도 오류가없는 구문으로 이어지지는 않는 개행 문자. 마지막으로, 나는 몇 줄을 제거했다. 이로 인해 오류가없는 구문이 표시되었지만 구문 강조는 여전히 발생하지 않았습니다. –