编译原理 Chapter1 Introduction 第一章 简介

本博客为博主阅读Alfred V. Aho 等所著 编译原理(英文版)过程中所记录的摘要;

Start date and time of this blog: Mon Jan 18, 2015 22:24
End date and time of this blog: to be updated

Main Part of this Blog

What is a compiler briefly?
A software system for translating a program language into a form in which can be executed by a computer.

Two basic types of language translators:

1. Compiler:

A compiler translates the source language into an equivalent program, usually known as a target language. It is the compiler’s job to report any errors in the source program that it detects during the translation process.

这里写图片描述
(Why this picture is so big here on the CSDN page? It’s annoying. If you know why, plz comment bellow to help me get rid of this problem. Thx a lot.)

If a target program is generated, than we can feed the target program with inputs and it would not be long before target program creates outputs
这里写图片描述



2. Interpreter:

Directly executes the operations specified in the source program on inputs supplied by the user, and gives out outputs.

这里写图片描述


Contrasts:

  • The machine language target program produced by a compiler is usually much faster than an interpreter at mapping inputs to outputs.
  • However, an interpreter can usually give better error diagnostics than a compiler, because it executes the source program statement by statement.



3. A hybrid type

Some translator combines compilation and interpretation in one system, such as Java language.

A java source language program first be compiled into an intermediate form called bytecodes, which can then be interpreted by a virtual machine later. One of the advantages by doing this way is that the bytecodes can be reusable, which means you can interprete the bytecodes on any machines as long as they are installed with a java virtual machine, sometimes even through a network.

To speed up processing of inputs to outputs, some java compilers, called just-in-time compilers, translate the bytecodes into machine language immediately before they run the intermediate program to process the input.
这里写图片描述

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值