Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Compiler_hw3_interpreter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lang0909
Compiler_hw3_interpreter
Commits
cf733341
Commit
cf733341
authored
5 years ago
by
lang0909
Browse files
Options
Downloads
Patches
Plain Diff
Update README.md
parent
3ddd993f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+49
-0
49 additions, 0 deletions
README.md
with
49 additions
and
0 deletions
README.md
+
49
−
0
View file @
cf733341
...
...
@@ -43,6 +43,55 @@ bison --version
## 기능 설명
-
상수
-
정수형 상수(int)와 실수형 상수(double)를 지원한다.
-
double은 normal한 형태만 지원한다.
-
변수
-
변수는 기본적으로 선언하지 않고 사용한다.
-
변수의 type은 저장되는 값에 의해 결정된다. 실행시 변경도 가능하다.
-
변수에 값을 저장하지 않고 사용할 수 있으나 값을 예측할 수 없다.
-
ex) i = 10; // 변수 i는 int형
-
ex) i=3.4; // 변수 i는 double형으로 변경
-
수식(expression)과 연산자
-
가감승제 연산자('+', '-', '
*
', '/') - 비교 연산 ('>', '>=', '<', '<=', '==', '!=')
-
assignment 연산자(=)
-
정수, 실수 혼합식은 실수로 형을 변환함
-
문장
-
수식문장(expression statement)
-
수식에 ';'를 넣어 문장을 만든다.
-
ex) sum = 0; sum = sum + i;
-
if문
-
**if**
(
*exp*
)
*statement*
**else**
*statement*
-
while문
-
**while**
(
*exp*
)
*statement*
-
출력문
-
**print**
*exp;*
**//exp의 계산 결과를 화면에 출력함**
-
ex) print 10;
-
print a
*
b;
-
print a=b;
**//b를 a에 저장한 후 그 결과인 a를 출력**
-
block문
-
*{statement_list}*
## 입력및출력 예시
-
sample1.mc


-
sample2.mc


-
sample3.mc


This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment