Nhập môn chương trình dịch
Nhập môn chương trình dịch
1
9/10/2016
Where ever input has a structure one can think of language processing
xxxxxxxxx 9x
xxxxxxxxx 9x
xxxxxxxxx 9x
xxx 3b 3x
xxx 3 9x
3b 3x
xxx 6 3b 3x
3b 3x
xxx 3 9x
3b 3x
xxx 3b 3x
xxx 3b 3x
xxxxxxxxx 9x
xxxxxxxxx 9x
xxxxxxxxx 9x
5
Techniques for developing lexical analyzers, parsers, type checkers, run time
systems, code generator, optimization. Use of tools and specifications for
developing various parts of compilers
2
9/10/2016
References
Compilers: Principles, Tools and Techniques by Aho, Sethi and Ullman
soon to be replaced by “21st Century Compilers” by Aho, Sethi, Ullman, and Lam
References
Compiler Design by Wilhelm and Maurer
The Theory of Parsing, Translation and Compiling (vol 1 & 2) by Aho and Ullman (old classic)
3
9/10/2016
References
Bài giảng Lý thuyết và Thực hành Chương Trình Dịch.
Lê Anh Cường, khoa Công Nghệ, ĐHQG Hà nội, 2004
10
11
12
4
9/10/2016
13
Dễ hiểu hơn
Cho phép thực hiện các khai báo, chẳng hạn
khai báo biến
Phần lớn các ngôn ngữ cho phép lập trình
cấu trúc
Ví dụ: Fortran, Cobol, C, C++, Basic . . .
14
15
5
9/10/2016
Giải quyết bài toán dựa trên các ràng buộc đưa
ra cho chương trình chứ không phải giải thuật
của người lập trình.
Việc giải quyết bài toán do máy tính thực hiện
Phần lớn các ngôn ngữ dùng để lập trình logic,
giải quyết các bài toán trong lĩnh vực trí tuệ
nhân tạo
16
17
18
6
9/10/2016
19
20
Mã nguồnScannerParser…Code generatorMã
máyLoaderExecuter
Mã nguồnScannerParserThông dịch
21
7
9/10/2016
22
Compiler
Source program
Compiler
23
Interpreter
Source program
24