Chapter 1 Introduction Samuel College of Computer Science & Technology Harbin Engineering University.

Slides:



Advertisements
Similar presentations
Writing: letter of advice.
Advertisements

PROGRAMMING Introduction To Programming Definition Types Of Programming Languages Programming Language Paradigm Translator
吉林大学远程教育课件 主讲人 : 杨凤杰学 时: 64 ( 第六十二讲 ) 离散数学. 最后,我们构造能识别 A 的 Kleene 闭包 A* 的自动机 M A* =(S A* , I , f A* , s A* , F A* ) , 令 S A* 包括所有的 S A 的状态以及一个 附加的状态 s.
Chapter 16 Programming and Languages: Telling the Computer What to Do.
吉林大学远程教育课件 主讲人 : 杨凤杰学 时: 64 ( 第五十三讲 ) 离散数学. 定义 设 G= ( V , T , S , P ) 是一个语法结构,由 G 产生的语言 (或者说 G 的语言)是由初始状态 S 演绎出来的所有终止符的集合, 记为 L ( G ) ={w  T *
CS 104 Introduction to Computer Science and Graphics Problems Software and Programming Language (2) Programming Languages 09/26/2008 Yang Song (Prepared.
 符号表  标识符的作用: 声明部分:定义了各种对象及对应的属性和 使用规则。 程序体:对所定义的对象进行各种操作。 $ididname IdnameAttributeIR  必要性 Token : 新表-符号表(种类、类型等信息):
ASYMMETRY OF NULL SUBJECTS AND NULL OBJECTS IN CHINESE SPEAKERS ’ L2 ENGLISH Boping Yuan University of Cambridge.
Period II Unit 4 Where’s my backpack? 1. Learn the vocabulary words. 2. Talk about positions of objects. 3. Train the listening and speaking skills.
High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.
Unit 3 Asking the way (Sound time, Checkout time &Ticking time)
《 UML 分析与设计》 交互概述图 授课人:唐一韬. 知 识 图 谱知 识 图 谱知 识 图 谱知 识 图 谱.
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
Chapter 10: Compilers and Language Translation Invitation to Computer Science, Java Version, Third Edition.
Tell something about the future with more, less or fewer. There will be less fresh water because there will be more pollution in the sea.
CS 326 Programming Languages, Concepts and Implementation Instructor: Mircea Nicolescu Lecture 2.
Unit 9 Have you ever been to an amusement park? Section B.
Unit 4 Study (II) Step 1: Opening Remarks Step 2: Explain listening skills in Unit 4 在朗读或者谈话中,一个句子或短语当中,前面的 单词词尾是辅音,可以和后一个词首的元音连起来读。
. 第 二 周第 3 课时 上课时间 3 月 11 日(星期 三 ) 累计教案 个 课题 Module2 I can run really fast. 课型 reading 基 于教 学学 情目 与标 课设 标计 1. To get information from the reading material.
牛津高中英语牛津高中英语 ( 模块六 · 高二上学期 ). Task(2) Skills building2: asking questions Skills building3: writing a letter of apology 板块: 教学设计 — 课件 Unit 3.
初中进阶 (2272 期 ) 1 版 Federer visits children in Africa.
Unit 1 How can we become good learners?. textbook conversation aloud pronunciation sentence patient n. 教科书;课本 n. 交谈;谈话 adv. 大声地;出声地 n. 发音;读音 n. 句子 adj.
Unit 5 Grammar(1) 教学目标 : 1. 识别 五种基本句型结构。 2. 运用五种基本句型造句。
1 Programming Languages Fundamentals Cao Hoaøng Truï Khoa Coâng Ngheä Thoâng Tin Ñaïi Hoïc Baùch Khoa TP. HCM.
Chapter 3 Programming Languages Unit 1 The Development of Programming Languages.
CSC3315 (Spring 2009)1 CSC 3315 Languages & Compilers Hamid Harroud School of Science and Engineering, Akhawayn University
1 Chapter 1 Introduction. 2 Outlines 1.1 Overview and History 1.2 What Do Compilers Do? 1.3 The Structure of a Compiler 1.4 The Syntax and Semantics of.
Unit 16 What’s it made of? 执教人: 滕北中学 YANG Lesson 61.
张掖市第一中学 李玉红. What do you want to be when you grow up? I want to be a scientist.
Topic #1: Introduction EE 456 – Compiling Techniques Prof. Carl Sable Fall 2003.
Welcome to Class13 Grade 9 上派初中 梁昌平. Unit 2 We all own English. Module 7 English for you and me.
1 Compiler Design (40-414)  Main Text Book: Compilers: Principles, Techniques & Tools, 2 nd ed., Aho, Lam, Sethi, and Ullman, 2007  Evaluation:  Midterm.
外研版 高一年级 ( 必修 1) Module 1 外研版 高一年级 ( 必修 1) Module 1.
Unit 1 It`s Time to Play the Violin 地掌中心校 鱼 虹 The first lesson.
Section A (1a–1c & 3b) Aims and language points: Teaching aims (教学目标) 1. 学会用 will 预测将来的生活。 2. 预测未来生活的发展趋势,对未来充满信心和希望。 3. 本节课旨在愉快的学习交流环境,通过听、说来培养学生 运用知识的能力,并让学生能在做中学,通过课堂的各种实践.
Introduction CPSC 388 Ellen Walker Hiram College.
力的合成 力的合成 一、力的合成 二、力的平行四边形 上一页下一页 目 录 退 出. 一、力的合成 O. O. 1. 合力与分力 我们常常用 一个力来代替几个力。如果这个 力单独作用在物体上的效果与原 来几个力共同作用在物体上的效 果完全一样,那么,这一个力就 叫做那几个力的合力,而那几个 力就是这个力的分力。
FOUNDATION IN INFORMATION TECHNOLOGY (CS-T-101) TOPIC : INFORMATION SYSTEM – SOFTWARE.
Compiler Construction (CS-636)
Compiler Introduction 1 Kavita Patel. Outlines 2  1.1 What Do Compilers Do?  1.2 The Structure of a Compiler  1.3 Compilation Process  1.4 Phases.
Chapter 1: Introduction 1 Compiler Designs and Constructions Chapter 1: Introduction Objectives: Course Objectives Introduction Dr. Mohsen Chitsaz.
Good Taste, Bad Taste Taste: the ability to judge if something is good or bad in things like art, fashion, and social behaviour. eg: They all admired her.
 Computer Languages Computer Languages  Machine Language Machine Language  Assembly Language Assembly Language  High Level Language High Level Language.
Subject. 主语可以用下面这些成分表示:名 词、代词、数词、动名词、不定式、 词组、从句。 Subject 主语.
初中基础 (2298 期 ) 45 版 Chinese sci-fi success.
Section A(2a-Grammar Focus & 3b-3c) Aims and language points: Teaching aims (教学目标) 1. 掌握有关的职业名称。 2. 能够表达自己的职业理想以及未来计划。 3. 本节课旨在愉快的学习交流环境,通过听、说来培养学生运用.
Introduction to Language Programming Hierarchy of programming lang. Based on machine independences: 1. Machine language 2. Assembly language 3. Higher.
Compiler Construction CPCS302 Dr. Manal Abdulaziz.
CSC 4181 Compiler Construction
XP Classroom Activities: Evaluation and Reflection College of Foreign Languages, CQU (July 2008)
Section A(1a-2c). Aims and language points: Teaching aims (教学目标) 1. 主要是学习一般过去时的定义,能用一般过去时描述过去发生的事情, 学会使用一般过去时的陈述句,及一般疑问句和答语。 2. 学会使用知道 go, milk, ride,
BEIJING JIAOTONG UNIVERSITY LIBRARY 主讲人:罗平 2007 年 4 月.
一、年级:五年级 二、单元: Unit 4 三、课题: An English friend 四、课型:新授课 五、教学内容:单元 Part A 简要提示.
Presented by : A best website designer company. Chapter 1 Introduction Prof Chung. 1.
2a Listen and check( )the questions you hear. Questions Questions 1. Do you learn English by watching English-language videos? videos? 2. Do You ever.
Unit 2 School life Integrated skills. 一、年级:八年级 二、教学内容: 8A Unit 2 School life 三、课型 : Integrated skills 四、教学目标 1. 知识目标 能够听懂与学校之间比较信息相关的四会词汇 以及重点句型。 简要提示.
Can you play the guitar? Unit 1 guitar play the guitar —Can you play the guitar? —Yes, I can. — No, I can’t. =can not.
Unit 4 Creatures large and small Module 2. Grammar.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Prologue Sung-Dong Kim, Dept. of Computer Engineering, Hansung University.
Programming Languages
Objective of the course Understanding the fundamentals of the compilation technique Assist you in writing you own compiler (or any part of compiler)
Introduction to computer software. Programming the computer Program, is a sequence of instructions, written to perform a specified task on a computer.
Chapter 1 Introduction Samuel College of Computer Science & Technology Harbin Engineering University.
CHAPTER 1 INTRODUCTION TO COMPILER SUNG-DONG KIM, DEPT. OF COMPUTER ENGINEERING, HANSUNG UNIVERSITY.
Chapter 1 Introduction.
Chapter 1 Introduction.
Compiler Lecture 1 CS510.
Chapter 10: Compilers and Language Translation
Presentation transcript:

Chapter 1 Introduction Samuel College of Computer Science & Technology Harbin Engineering University

Objectives by the end of the lesson students will be able to –make sure the mainframe of the compiler construction –tell the features of the problem computer can solve

Compilers Compilers are computer programs that translate one language to another. –Very complex program from 10,000 to 1,000,000 lines of code. Its input is a program written in its source language. –Usually, the source language is a high-level language (C, C++, etc). It produces an equivalent program written in its target language. –The target language is object code (machine code) for the target machine.

Bilingual A person who knows and uses two languages. In everyday use the word bilingual usually means a person who speaks, reads, or understands two languages equally well (a balanced bilingual), but a bilingual person usually has a better knowledge of one language than of the other. English Source language

Compilers

双语 一个能运用两种语言的人。 在他的日常生活中能将一门外语和本族语基本等 同地运用于听、说、读、写,当然他的母语语言 知识和能力通常是大于第二语言的。 Chinese Target language

Interpreters An interpreter is a language translator like a compiler. The difference: the source program is executed immediately, not after translation is complete.

Bilingual education The use of a second or foreign language in school for the teaching of content subjects. The use of the child ’ s home language when the child enters school but later a gradual change to the use of the school language for teaching some subjects and the home language for teaching others. This is sometimes called maintenance bilingual education. English Source language

Bilingual education The use of a second or foreign language in school for the teaching of content subjects. The use of the child ’ s home language when the child enters school but later a gradual change to the use of the school language for teaching some subjects and the home language for teaching others. This is sometimes called maintenance bilingual education.

Bilingual education The use of a second or foreign language in school for the teaching of content subjects. 能在学校里使用第二语言或外语进行各门学科的教学。 The use of the child ’ s home language when the child enters school 学生刚进入学校时使用本族语 but later a gradual change to the use of the school language for teaching some subjects 然后逐渐地使用第二语言进行部分学科的教学 and the home language for teaching others. 其它学科仍使用母语教学 This is sometimes called maintenance bilingual education. 这种模式称之为:保持型双语教学。 Chinese? Target language?

Interpreters An interpreter is a language translator like a compiler. The difference: the source program is executed immediately, not after translation is complete. Programming language can be either interpreted or compiled. Interpreted languages: BASIC, LISP, Java Compiled languages: FORTRAN, C, C++. Interpreters share many operations with compilers.

Machine Language Initially, the programs were written in machine language – numeric codes that represented the actual machine operations to be performed. C moves number 2 to the location Writing such codes is time consuming and tedious.

Assembly Language In assembly language instructions and memory locations are given symbolic forms. MOV X, 2 An assembler translates the symbolic codes and memory locations into corresponding numeric codes. Advantages: –Great improvement in speed and accuracy of writing programs. –Still used today. Disadvantages: –Still not easy to write and difficult to read and understand. –Machine dependent.

High-level Languages Nearly resembles mathematical notation or natural language. Independent on any particular machine. Capable of being translated into executable code X = 2 Need a program that performs translation. Is it possible? Is generated object code efficient?

Theoretical Foundations Noam Chomsky’s study of the structure of natural languages. –Classification of languages according to the complexity of their grammars and the algorithms to recognize them. Context-free grammars are the most useful for programming languages –Study of the parsing problem, which become a standard part of compiler theory. Study of finite automata and regular expressions. –Led to symbolic methods for expressing the structure of words of a programming language Optimization techniques (code improvement techniques).

A Code Optimization Example What machine-independent optimizations are applicable to the following example?

A Code Optimization Example: Result

Compilers Compilers are computer programs that translate one language to another. –Very complex program from 10,000 to 1,000,000 lines of code. Its input is a program written in its source language. It produces an equivalent program written in its target language.

Discussion 1 If you wanna translate English into Chinese, how many steps will you follow? And what are they?  The left side On the other hand, when you translate a Chinese sentence into an English one, what are you going to do? The right side  Step by step, tell me the steps.

Push the elephant into the refrigerator GO!

Translation Process This is a book. Step 1: lexical analysis This / is / a / book /. Step 2: syntax analysis This  subject is  predicate a  quantifier book  object.  end Step 3: semantic analysis This  pronoun 这 is  copula 是 a  numeral 一 book  noun 书.  period 。 Step 4: This is a book. Step 5: 这是一书。 Step 6: 这是一本书。

the Problem Computer can Solve Discussion 2: In your opinion, what kind of problem can be solved by computer? Tell me the features of the problem which can be solved by computer. The right side  And what can not be? Just provide the reasons that some problems can not be processed through a computer.  The left side Go!

Conclusion The features of the problem computer can solve are just as follows: 1.The problem can be specified by computer 2.Be able to find the relevant algorithm 3.The algorithm has reasonable temporal complexity and spatial complexity