编译器 第一周

Compilers
            off-line         data 
                               |  
    program -----> C ------> exec
                               |
                             output
  1. Lexical Analysis : 词法分析
  2. Parsing :语法分析
  3. Semantic Analysis :语义分析
  4. Optimization :优化
  5. Code Generation :代码产生器
Interpreters

program —–>

        I  --------> output

Data ——>
L | P | S | O |CG

The Economy of Programming Languages
  • why are there so many programming languages?
  • why are there new programming languages?

    1. Programmer training is the dominant cost for a programming language.
    2. widely used language are slow to change.
    3. easy to start a new language.
    4. productivity > training cost.
    5. language adopted to fill a void.
    6. new languages tend to look like old language.
  • what is a good programming language?

    1. There is no universally accepted metric for language design.
  • Application domains have distinctive/conflicting needs.

  • scientific computing => good FP、good arrays、operations on arrays、parallelism => formula translation
  • business applications => persistence、report generation、data analysis =>SQL(the database query language)
  • systems programming =>control of resources、real time constraints => C/C++
Cool Overview
  • Classroom Object Oriented Language(COOL)
  • Designed to be implementable in a short time
  • give a taste of implementation of modern

    1. Abstraction
    2. static typing
    3. Reuse(inheritance)
    4. Memory management
    5. And more …
  • A complete compiler
    – Cool -> MIPS assembly language
  • in 5 programming assignments(PAS)
    1. Write a Cool program
    2. Lexical analysis
    3. Parsing
    4. Semantic analysis. plug compatible
    5. Code generation
    6. optimization
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值