Skip to content
Snippets Groups Projects
Commit 3fa18dc9 authored by lang0909's avatar lang0909
Browse files

Update README.md

parent d5798f11
Branches master
No related tags found
No related merge requests found
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
- flex 2.6.4 - flex 2.6.4
## 사용 시 주의사항 ## 사용 시 주의사항
### Makefile에 정의 된 매크로를 사용하여 조금 더 편리하게 사용한다.
**입력및실행**
```bash ```bash
make make
...@@ -17,16 +18,41 @@ make ...@@ -17,16 +18,41 @@ make
1+2 1+2
``` ```
**입력및실행** **make로 생성 된 object 파일 삭제**
```bash ```bash
make clean 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를 계산하여 그 값을 출력한다.
![tree-example](./images/tree-example.JPG)
#### 기능 설명
## 입력및출력 예시
### 입력및출력 예시 ![input&output1](./images/input_and_output1.jpg) ![input&output2](./images/input_and_output2.jpg) ![input&output3](./images/input_and_output3.jpg)
\ No newline at end of file \ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment