diff --git a/README.md b/README.md index 398e3646b7a8c24cb5fd94c424780a16697569fc..51ec62f9f656a4e07e17ba9f453f0f78a451751b 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,8 @@ - flex 2.6.4 ## 사용 시 주의사항 -### Makefile에 정의 된 매크로를 사용하여 조금 더 편리하게 사용한다. + +**입력및실행** ```bash make @@ -17,16 +18,41 @@ make 1+2 ``` -**입력및실행** +**make로 생성 된 object 파일 삭제** ```bash make clean ``` -**make로 생성 된 object 파일 삭제** +**flex가 설치되어 있지 않을 때 설치 및 version확인 방법** + +```bash +sudo apt-get install flex -y +flex --version +``` + +## 기능 설명 + +- operator + - binary operator로 '+', '-', '*', '/', '='(assignment) + - unary operator '-' + - ex) -5 + -10 ===> -15 + - --(5+10) ===> 15 + - -(-(5+10)) ===> 15 + +- 상수 + - integer + - real number + +- assignment operator(=)는 right associativity를 가진다. + - ex) a = b = 10 ===> a = (b = 10) (결과 값은 10) +- interpreter는 2단계로 이루어져 있다. + - 1단계 : Parsing 하면서 syntax tree를 생성한다. + - 2단계 : 생성된 syntax tree를 계산하여 그 값을 출력한다. +  -#### 기능 설명 +## 입력및출력 예시 -### 입력및출력 예시 \ No newline at end of file +   \ No newline at end of file