Teknik Kompilator Compiler Techniques IKI 40800 Dosen Heru

  • Slides: 11
Download presentation
Teknik Kompilator (Compiler Techniques) IKI 40800 Dosen: Heru Suhartanto http: //staff. ui. ac. id/heru

Teknik Kompilator (Compiler Techniques) IKI 40800 Dosen: Heru Suhartanto http: //staff. ui. ac. id/heru E-mail: heru@cs. ui. ac. id Room : Gedung A, 1216 n Kuliah ini membahas beberapa teknik pembuatan suatu kompilator berdasarkan tatabahasa yang diberikan. n Teknik-teknik ini akan dibahas sesuai dengan tahap pembuatan suatu kompilator. Dimulai dari tahap pembacaan program sumber, analisis tatabahasa, dan diakhiri oleh pembentukan kode (bahasa sasaran). n Peserta kuliah akan mempelajari model suatu kompilator sesuai dengan tahapan tersebut, mengembangkannya dengan menambah fitur suatu kompilator. Introduction 1

References n Semester : Genap (was Ganjil in 2008/2009) 1. Compilers: Principles, Tehchniques, and

References n Semester : Genap (was Ganjil in 2008/2009) 1. Compilers: Principles, Tehchniques, and Tools Aho, A. V. , Sethi, R. , Ullman, J. D. Addison Wesley 1986 2. Modern Compiler Implementation in Java http: //www. cs. princeton. edu/~appel/modern/java/ 3. Dick Grune et. Al, Modern Compiler Design, John Wiley & Sons, 2000 4. Lex - A Lexical Analyzer Generator (available on line - aol) 5. Yacc - Yet Another Compiler-Compiler (aol) 6. Heru Suhartanto, Model Pemroses Bahasa Pemrograman , Dengan tools berbasis Java, 2006. , http: //telaga. cs. ui. ac. id/~heru/publications/mode. User. Guidel. Java. pdf n Resources : see at scele Introduction 2

Topics and Ref. To Text book n Week n 1 -2 3 -4 5

Topics and Ref. To Text book n Week n 1 -2 3 -4 5 5 -6 7 8 9 -10 11 -12 13 n n n n Topics Introduction, Lexical Analysis Parsing Symbol Table Syntax directed translation Type checking Run-time organization Intermediate code generation Code generation Code optimization Introduction Chapters/Sections 2. 1 -2. 6, 3. 1 --3. 4 2. 4, 4. 1 -4. 5, 4 -7 2. 7, 7. 6 2. 5, 5. 1 -5. 5 6. 1 -6. 2 7. 1 -7. 3, 7. 4 -7. 5 8. 1 -8. 3 9. 1 -9 -4 10. 1 -10. 2 3

Tools: http: //telaga. cs. ui. ac. id/Web. Kuliah/IKI 40800/jtools. html – http: //www. cs.

Tools: http: //telaga. cs. ui. ac. id/Web. Kuliah/IKI 40800/jtools. html – http: //www. cs. princeton. edu/~appel/modern/java/JLex// – http: //www. cs. princeton. edu/~appel/modern/java/CUP// – http: //www 2. informatik. unibw-muenchen. de/Research/Tools/JACCIE/jaccie. html – http: //www. jflex. de// – http: //troi. lincom-asg. com/~rjamison/byacc/ – http: //www. javaworld. com/javaworld/jw-12 -1996/jw-12 -jack. html Introduction 4

n Jlex, CUP and Jaccie are available here at n http: //telaga. cs. ui.

n Jlex, CUP and Jaccie are available here at n http: //telaga. cs. ui. ac. id/Web. Kuliah/IKI 40800/tools/ n Cara penilaian : lihat BRP n Assignments : lihat BRP Introduction 5

RULES · · · Exams and homework Cheating=0 mark, Homework Deduction of 5% for

RULES · · · Exams and homework Cheating=0 mark, Homework Deduction of 5% for each day lateness, unaccepted for 1 (or more) week delays. Cheating : any kind of plagiarism ! Introduction 6

Introduction: Definisi n n A compiler is a program that accepts as input a

Introduction: Definisi n n A compiler is a program that accepts as input a program text in a certain language and produces as output a program text in another language, while preserving the meaning of that text. The process is called translation. The input is considered the source language and the output is target language. The language the compiler itself is written in is called the implementation language. Introduction 7

Introduction: kenapa perlu teknik kompilasi [4]? Compiler construction is a very succesful branch of

Introduction: kenapa perlu teknik kompilasi [4]? Compiler construction is a very succesful branch of computer science, and one of the earliest to earn that predicate; n Given its close relation to file conversion, it has wider application than just compilers; n It contains many generally useful algorithms in a realistic setting. n Introduction 8

Introduction : proses kompilasi dan running a compiler [fig 1. 1 – 4] Introduction

Introduction : proses kompilasi dan running a compiler [fig 1. 1 – 4] Introduction 9

Introduction: perbedaan compiler dan interpreter [fig 1. 3 – 4] Introduction 10

Introduction: perbedaan compiler dan interpreter [fig 1. 3 – 4] Introduction 10

Introduction: struktur suatu kompilator [fig 1. 21 – 4] AST : : Abstract Syntax

Introduction: struktur suatu kompilator [fig 1. 21 – 4] AST : : Abstract Syntax Tree Introduction 11