Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
battle_c
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
이장원
battle_c
Commits
f86e47f8
Commit
f86e47f8
authored
4 years ago
by
이장원
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
https://git.ajou.ac.kr/leejangwon/battle_c
into master
parents
58222ae9
600d9743
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
8.6/note.md
+0
-96
0 additions, 96 deletions
8.6/note.md
with
0 additions
and
96 deletions
8.6/note.md
deleted
100644 → 0
+
0
−
96
View file @
58222ae9
# 컴파일러 vs 인터프리터
컴파일러와 인터프리터는 고급언어로 작성된 원시 프로그램(Source Program)을 목적 프로그램(Object Program)으로 번역하는 번역 프로그램이며, 프로그램 번역 방식에 따라 구분된다.
## 컴파일러
1.
컴파일러는 고급 언어로 작성된 프로그램 전체를 목적 프로그램으로 번역한 후, 링킹 작업을 통해 컴퓨터에서 실행 가능한 실행 프로그램을 생성한다.
2.
번역 실행 과정을 거쳐야 하기 때문에 번역 과정이 번거롭고 번역 시간이 오래 걸리지만, 한번 번역한 후에는 다시 번역하지 않으므로 실행 속도가 빠르다.
3.
컴파일러를 사용하는 언어에는 C언어 Java 등이 있다.
## 인터프리터
1.
인터프리터는 고급 언어로 작성된 프로그램을 한 줄 단위로 받아들여 번역하고, 번역과 동시에 프로그램을 한 줄 단위로 즉시 실행시키는 프로그램이다.
2.
프로그램이 직접 실행되므로 목적 프로그램은 생성되지 않는다.
3.
줄 단위로 번역, 실행되기 떄문에 시분할 시스템에 유용하며 원시 프로그램의 변화에 대한 반응이 빠르다.
4.
번역 속도는 빠르지만 프로그램 실행 시 매번 번역해야 하므로 실행 속도는 느리다.
5.
CPU의 사용시간의 낭비가 크다.
6.
인터프리터를 사용하는 언어에는 Python, BASIC, SNOBOL, LISP, APL등이 있다.
## 차이점
| | 컴파일러 | 인터프리터 |
|--|--|--|
| 번역단위 | 전체 | 행(줄) |
| 목적 프로그램 | 생성함 | 생성하지 않음 |
| 실행 속도 | 빠름 | 느림 |
| 번역 속도 | 느림 | 빠름 |
| 관련 언어 | C, Java | Python, BASIC, LISP, APL, SNOBOL |
# GCC 명령어 옵션
*
-o
지정한 파일명에 출력한다.
```
$ gcc -o 00.option-o 00.option-o.c
```
!
[
o
](
../Images/o.png
)
*
-E
전처리하여 전처리된 소스 파일(.i)을 생성한다.
```
$ gcc -E 01.option-E.c
```
-E 옵션만 사용하면 전처리된 결과를 stdout에 보여주기만 한다.
```
$ gcc -E 01.option-E.c > 01.option-E.i
```
redirection으로 .i를 생성한다.
!
[
E
](
../Images/E.png
)
*
-S
컴파일하여 어셈블리 파일(.s)을 생성한다.
```
$ gcc -S 02.option-S.i
```
.s 생성(.i 없어도 가능)
!
[
S
](
../Images/S.png
)
*
-c
어셈블하여 목적 파일(.o)을 생성한다.
```
$ gcc -c 03.option-c.s
```
.o 생성(.i나 .s 없어도 가능)
!
[
c
](
../Images/c.png
)
*
-D
외부에서 매크로를 define한다.
```
$ gcc -DNO 05.option-D.c
```
!
[
D
](
../Images/D.png
)
*
-g
운영체제 고유의 형식으로 디버깅 정보를 만든다.
```
$ gcc -g 06.option-g.c
```
!
[
g_Raspberry_Pi
](
../Images/g_Raspberry_Pi.png
)
on Raspberry Pi
!
[
g_Git_Bash
](
../Images/g_Git_Bash.png
)
on Git Bash
*
-Wall
GCC가 제공할 수 있고, 일반적으로 유용한 모든 경고 메시지 출력한다.
```
$ gcc -Wall 07.option-Wall.c
```
!
[
Wall
](
../Images/Wall.png
)
*
-I(upper case of i)
헤더 파일을 검색할 디렉터리를 추가한다.
```
$ gcc -ImyInclude 09.option-I.c
```
!
[
I
](
../Images/I.png
)
\ No newline at end of file
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