Skip to content

sunwoo611/compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

COSE312 - Compilers, 2025 Spring

실습 환경 설정

1. Docker 설치

https://www.docker.com/

설치 확인: 터미널에서 docker --version 실행 (버전은 달라도 됨)

ta@cose312:~$ docker --version
Docker version 27.5.1, build 9f9e405

2. Visual Studio Code (VSC) 설치

https://code.visualstudio.com/

3. VSC Extension Dev Containers 설치

dev_containers

4. Dev containers 실행

  1. Clone this repository

    ta@cose312:~$ git clone https://github.com/kupl-courses/COSE312-2025spring.git

    (필요시 git 설치: https://git-scm.com/downloads)

  2. Open in VSC

    ta@cose312:~$ code COSE312-2025spring
  3. 우측 하단 메세지 내 좌측 버튼 Reopen in Container 클릭 vsc_reopen_in_container-1

    위 메세지가 없으면 좌측 최하단 버튼 Open a Remote Window 클릭 후 Reopen in Container 클릭 vsc_reopen_in_container-2

코드 실행

REPL 사용

VSC 터미널에서 ocaml 실행

$ ocaml

Tip. 현재 디렉토리에 .ocamlinit 파일 생성 후 #use "<파일명>.ml"을 작성하면 REPL 실행시에 해당 파일을 자동으로 불러옴

.ml 파일 컴파일 및 실행 (;;로 구분 필요 없음)

VSC 터미널에서 ocamlc -o <실행파일명> <파일명>.ml 또는 ocamlopt -o <실행파일명> <파일명>.ml 실행

$ ocamlopt -o main main.ml
$ ./main

OCaml 스크립트 실행 (;;로 구분 필요)

VSC 터미널에서 ocaml <파일명>.ml 또는 ocaml < <파일명>.ml 실행

$ ocaml < src/main.ml

업데이트된 과제 템플릿 다운로드

COSE312-2025spring 디렉토리에서 git pull 실행

$ pwd
/workspace/COSE312-2025spring
$ git pull

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages