目录

  • 1 Chapter 1 Introduction
    • 1.1 1.0 Course Contents
    • 1.2 1.1 Basic Conception
      • 1.2.1 Lecture 1
      • 1.2.2 Lecture 2
    • 1.3 1.2 Compiler Structure
      • 1.3.1 Lecture 1
      • 1.3.2 Lecture 2
      • 1.3.3 Lecture 3
    • 1.4 1.3 The Technique of Compiler Developing
  • 2 Chapter 2 Conspectus of Formal Language
    • 2.1 2.1 Alphabets and Strings
      • 2.1.1 Lecture 1
      • 2.1.2 Lecture 2
    • 2.2 2.2 Grammars and its Categories
      • 2.2.1 Lecture 1
      • 2.2.2 Lecture 2
    • 2.3 2.3 Languages and Parse Tree
      • 2.3.1 Lecture 1
      • 2.3.2 Lecture 2
    • 2.4 2.4 Notes of Formal Language
    • 2.5 2.5 Basic Parsing Techniques
      • 2.5.1 Lecture 1
      • 2.5.2 Lecture 2
  • 3 Chapter 3 Finite Automata
    • 3.1 3.1 Formal Definition of FA
      • 3.1.1 Lecture 1
      • 3.1.2 Lecture 2
    • 3.2 3.2 Transition from NDFA to DFA
      • 3.2.1 Lecture 1
      • 3.2.2 Lecture 2
      • 3.2.3 Lecture 3
    • 3.3 3.3 RG and FA
    • 3.4 3.4 Regular Expression & Regular Set
      • 3.4.1 Lecture 1
      • 3.4.2 Lecture 2
  • 4 Chapter 4 Scanner(Lexical Analyzer)
    • 4.1 4.1 Lexical Analyzer and Tokens
      • 4.1.1 Lecture 1
      • 4.1.2 Lecture 2
    • 4.2 4.2 Step for developing a lexical analyzer
    • 4.3 4.3  Dealing with Identifier
    • 4.4 4.4  Using Regular Expressions
    • 4.5 4.5 Using Flex
      • 4.5.1 Lecture 1
      • 4.5.2 Lecture 2
  • 5 Chapter 5 Top-Down Parsing
    • 5.1 5.0 Push Down Automata (PDA, Added)
      • 5.1.1 Lecture 1
      • 5.1.2 Lecture 2
      • 5.1.3 Lecture 3
    • 5.2 5.1 Elimination Left-Recursion
    • 5.3 5.2 LL(k) Grammar
      • 5.3.1 Lecture 1
      • 5.3.2 Lecture 2
    • 5.4 5.3 Deterministic LL(1) Analyzer Construction
    • 5.5 5.4 Recursive-descent (Non-backtracking) parsing
    • 5.6 5.5 复习与结课
      • 5.6.1 Lecture1 结课感言
      • 5.6.2 Lecture 2 关于复习
      • 5.6.3 Lecture 3 习题讲解
  • 6 Chapter 6 bottom-up Parsing and precedence analyzer
    • 6.1 6.1 Bottom-Up Parsing
    • 6.2 6.2 Phrase, Simple Phrase and Handle
    • 6.3 6.3 A Shift-Reduce Parser
    • 6.4 6.4 Some Relations on Grammar
    • 6.5 6.5 Simple Precedence Parsing
    • 6.6 6.6 Operator-Precedence Parsing
      • 6.6.1 Lecture 1
      • 6.6.2 Lecture 2
      • 6.6.3 Lecture 3
    • 6.7 6.7 Precedence Functions and Construction
  • 7 Chapter 7  LR Parsing
    • 7.1 7.1 LR Parsers
      • 7.1.1 Lecture 1
      • 7.1.2 Lecture 2
    • 7.2 7.2 Building a LR(0) parse table
      • 7.2.1 Lecture 1
      • 7.2.2 Lecture 2
    • 7.3 7.3 SLR Parse Table Construction
    • 7.4 7.4 Constructing Canonical LR(1) Parsing Tables
    • 7.5 7.5 LALR Parsing Tables Construction
    • 7.6 7.6 Using Ambiguous Grammars
    • 7.7 7.7 Yacc/Bison Overview
  • 8 Chapter 8 Syntax-Directed Translation
    • 8.1 8.1 Syntax-Directed Translation
      • 8.1.1 Lecture1
      • 8.1.2 Lecture 2
      • 8.1.3 Lecture 3
    • 8.2 8.2 Abstract Syntax Tree
    • 8.3 8.3 Intermediate Representation
      • 8.3.1 Lecture 1
      • 8.3.2 Lecture 2
  • 9 Chapter 9 Run-Time Environment
    • 9.1 9.1 Data Area & Attribute
    • 9.2 Section 9.2~9.4 & Section 9.8~9.9
    • 9.3 9.5 Parameter Passing
    • 9.4 9.6 Stack Allocation
    • 9.5 9.7 Heap allocation
  • 10 Chapter 10 Symbol Tables
    • 10.1 10.1 A symbol Table Class
    • 10.2 10.2 Basic Implementation Techniques
    • 10.3 10.3 Block-structured Symbol Table
    • 10.4 10.4 Implicit Declaration
    • 10.5 10.5 Overloading
  • 11 Chapter 11 Code Optimization
    • 11.1 11.1 Control Flow Graph
    • 11.2 11.2 Redundancies
    • 11.3 11.3 Loop Optimizations
    • 11.4 11.4 Instruction Dispatch
      • 11.4.1 Lecture 1
      • 11.4.2 Lecture 2
  • 12 Chapter 12 Code Generation
    • 12.1 12.1 Code generation issues
    • 12.2 12.2 Simple Stack Machine
    • 12.3 12.3 Register Machine
    • 12.4 12.4 A Simple Code Generator
  • 13 13 Extended Reading扩展阅读1 斯坦福大学公开课
    • 13.1 Lecture 1
    • 13.2 Lecture 2
    • 13.3 Lecture 3
    • 13.4 Lecture 4
    • 13.5 Lecture 5
    • 13.6 Lecture 6
    • 13.7 Lecture 7
    • 13.8 Lecture 8
    • 13.9 Lecture 9
    • 13.10 Lecture 10
    • 13.11 Lecture 11
    • 13.12 More sources
  • 14 14 Extended Reading 2 扩展阅读2 illinois.edu lectures
    • 14.1 Lecture 1 Overview
    • 14.2 Lecture 2 Strings, Languages, DFAs
    • 14.3 Lecture 3 More on DFAs
    • 14.4 Lecture 4 Regular Expressions and Product Construction
    • 14.5 Lecture 5 Nondeterministic Automata
    • 14.6 Lecture 6 Closure properties
    • 14.7 Lecture 7 NFAs are equivalent to DFAs
    • 14.8 Lecture 8 From DFAs/NFAs to Regular Expressions
    • 14.9 Lecture 9 Proving non-regularity
    • 14.10 Lecture 10 DFA minimization
    • 14.11 Lecture 11 Context-free grammars
    • 14.12 Lecture 12 Cleaning up CFGs and Chomsky Normal form
    • 14.13 Lecture 13 Even More on Context-Free Grammars
    • 14.14 Lecture 14 Repetition in context free languages
    • 14.15 Lecture 15 CYK Parsing Algorithm
    • 14.16 Lecture 16 Recursive automatas
    • 14.17 Lecture 17 Computability and Turing Machines
    • 14.18 Lecture 18 More on Turing Machines
    • 14.19 Lecture 19 Encoding problems and decidability
    • 14.20 Lecture 20 More decidable problems, and simulating TM and “real” computers
    • 14.21 Lecture 21 Undecidability, halting and diagonalization
    • 14.22 Lecture 22 Reductions
    • 14.23 Lecture 23 Rice Theorem and Turing machine behavior properties
    • 14.24 Lecture 24 Dovetailing and non-deterministic Turing machines
    • 14.25 Lecture 25 Linear Bounded Automata and Undecidability for CFGs
  • 15 15 Extended Reading3 扩展阅读3 Extended  Reference Books
    • 15.1 15.1 English Text Book
    • 15.2 15.2 编译原理(何炎祥,伍春香,王汉飞 2010.04)
    • 15.3 15.3 编译原理(陈光建主编;贾金玲,黎远松,罗玉梅,万新副主编 2013.10)
    • 15.4 15.4 编译原理((美)Alfred V. Aho等著;李建中,姜守旭译 2003.08)
    • 15.5 15.5 编译原理学习与实践指导(金登男主编 2013.11)
    • 15.6 15.6 编译原理及编译程序构造 第2版(薛联凤,秦振松编著 2013.02)
    • 15.7 15.7 编译原理学习指导(莫礼平编 2012.01)
    • 15.8 15.8 JavaScript动态网页开发案例教程
  • 16 16 中文版课件(pdf)辅助学习
    • 16.1 第1章 引论
    • 16.2 第2章 形式语言概论
    • 16.3 第3章 有穷自动机
    • 16.4 第4章 词法分析
    • 16.5 第5章 自上而下分析
    • 16.6 第6章 优先分析方法
    • 16.7 第7章 自下而上的LR(k)分析方法
    • 16.8 第8章 语法制导翻译法
    • 16.9 第9章 运行时的存储组织与管理
    • 16.10 第10章 符号表的组织与查找
    • 16.11 第11章 优化
    • 16.12 第12章 代码生成
  • 17 17 Extended Reading4 扩展阅读4 Static Single Assignment
    • 17.1 17.1 SSA-based Compiler Design
    • 17.2 17.2 A Simple, Fast Dominance Algorithm (Rice Computer Science TR-06-33870)
    • 17.3 17.3 The Development of Static Single Assignment Form(KennethZadeck-Presentation on the History of SSA at the SSA'09 Seminar, Autrans, France, April 2009)
    • 17.4 17.4 SPIR-V Specification(John Kessenich, Google and Boaz Ouriel, Intel Version 1.00, Revision 12 January 16, 2018)
    • 17.5 17.5 Efficiently Computing Static Single Assignment Form and the Control Dependence Graph
    • 17.6 17.6 Global Value Numbers and Redundant Computations
  • 18 18 Extended Reading4 扩展阅读5 Computer Science
    • 18.1 1 实地址模式和保护模式的理解
    • 18.2 2 实模式和保护模式
    • 18.3 3 实模式和保护模式区别及寻址方式
    • 18.4 计算机专业术语
    • 18.5 Bit Math in c Language
    • 18.6 Auto-generating subtitles for any video file
    • 18.7 Autosub
    • 18.8 C语言中的内联函数(inline)与宏定义(#define)
  • 19 19 相关学习
    • 19.1 龙书、鲸书和虎书
    • 19.2 Complexity
    • 19.3 MPC Complexity
    • 19.4 NP-completeness
    • 19.5 Computational complexity theory
  • 20 20 全球战疫-武汉战疫延伸与扩展
    • 20.1 Extraordinary G20 Leaders’ Summit Statement on COVID-19
    • 20.2 Experts urge proactive measures to fight virus
    • 20.3 covid-19病毒下贫穷国家
    • 20.4 正确理解病亡率、压平曲线、疫情高峰术语
    • 20.5 为什么全球经济可能陷入长期衰退
    • 20.6 为何新冠病毒检测会出现“假阴性”
    • 20.7 在纽约,几乎每个人身边都有人感染病毒
    • 20.8 An Address by Her Majesty The Queen
    • 20.9 Boris Johnson admitted to hospital over virus sympto
    • 20.10 Edinburgh festivals cancelled due to coronavirus
    • 20.11 US set to recommend wearing of masks
    • 20.12 Boris Johnson in self-isolation after catching coronavirus
    • 20.13 Covid-19:The porous borders where the virus cannot be controlled
    • 20.14 当欧洲人开始戴上口罩
    • 20.15 Lockdown and ‘Intimate Terrorism’
    • 20.16 Us Election 2020: Bernie Sanders Suspends Presidential Campaign
    • 20.17 The aircraft carrier being infected with the coronavirus
    • 20.18 Spent to the W.H.O.
    • 20.19 Unemployment
    • 20.20 The beat of a heart the glimmer of a soul
    • 20.21 Coronavirus pandemic: EU agrees €500bn rescue package
    • 20.22 the world after coronavirus冠状病毒之后的世界
  • 21 21 课程思政方案
    • 21.1 21.1 课程思政
    • 21.2 21.2 实施方案
covid-19病毒下贫穷国家

covid-19病毒下贫穷国家:雪上加霜                

               

来源:卫报双语阅读  公众号

The new coronavirus is causing havoc in rich countries. Often overlooked is the damage it will cause in poor ones, which could be even worse. Official data do not begin to tell the story. As of March 25th Africa had reported only 2,800 infections so far; India, only 650. But the virus is in nearly every country and will surely spread. There is no vaccine. There is no cure. A very rough guess is that, without a campaign of social distancing, between 25% and 80% of a typical population will be infected. Of these, perhaps 4.4% will be seriously sick and a third of those will need intensive care. For poor places, this implies calamity.

   新型冠状病毒正在富裕国家肆虐,但人们常常忽视它会给贫穷国家造成的伤害,而情况往往可能更糟糕。官方数据现在并不能很好地展现真正的情况。截至3月25日,非洲仅报告了2800例感染。 而印度只有650例。但是该病毒现在几乎传遍每个国家,而且肯定会继续传播。没有疫苗。没有治愈方法。一个非常粗略的猜测是,如果不进行社会隔离,将有25%至80%的典型人群会受到感染。其中,可能有4.4%的人患有严重疾病,其中三分之一需要重症监护。 而对于贫穷的地方来说,这意味着灾难。

  • cause havoc  havoc我记得讲过很多次,看看它的英文释义:a situation in which there is a lot of damage, destruction or confusion,也就是指造成大量的破坏,损害的情况都可以称为havoc,比如某种

    The floods caused havoc throughout the area. 洪水给整个地区带来了灾害。

    These insects can wreak havoc on crops. 这些昆虫可严重危害农作物

  • 灾难,浩劫等。除了和cause搭配外,也可以用wreak havoc on.......表示对.....造成大量伤害。看一下例句:

  • intensive care 重症监护,例如我们常见的ICU,全称为:intensive care unit=重症监护室


Social distancing is practically impossible if you live in a crowded slum. Hand-washing is hard if you have no running water. Governments may tell people not to go out to work, but if that means their families will not eat, they will go out anyway. If prevented, they may riot.

如果您住在一个拥挤的贫民窟,那想进行社会隔离那几乎是不可能的。如果没有自来水,那想洗个手都很难。政府可能会告诉人们不要外出工作,但是如果这意味着他们的家人没饭吃,那他们还是会外出。如果被阻止,他们可能会暴动。

slum 贫民窟,棚屋区,我想到了一个同义的单词:ghetto,在美式英语的口语中,ghetto还 可以用来指代某事物非常糟糕。例如你在餐馆点的菜很糟糕,则可以用It iss ghetto.来形容东西的难吃。

  • riot 在这里做动词,表示闹事,发生骚乱。我想到一个表达riot police=防爆警察,可不要望文生义以为是“骚乱的警察”。


So covid-19 could soon be all over poor countries. And their health-care systems are in no position to cope. Many cannot deal with the infectious diseases they already know, let alone a new and highly contagious one. Health spending per head in Pakistan is one two-hundredth the level in America. Uganda has more government ministers than intensive-care beds. Throughout history, the poor have been hardest-hit by pandemics. Most people who die of aids are African. The Spanish flu wiped out 6% of India’s entire population.

因此,covid-19病毒很快就会遍布贫困国家。他们的医疗保健系统无能为力。许多人无法应对他们已经知道的传染病,更不用说一种新的且传染性极强的传染病了。巴基斯坦的人均医疗保健支出只有美国的百分之。乌干达的政府部长人数比重症监护病床的个数还多。纵观历史,穷人受大流行病的伤害最大。大多数死于艾滋病的人都是非洲人。西班牙流感杀死了印度全部人口的6%。

Dozens of developing countries have ordered lockdowns. India has announced a “total ban” on leaving home for 21 days (see Asia section). South Africa has deployed the army to help enforce one. They may slow the disease, but they are unlikely to stop it. 

数十个发展中国家已经下令封锁。印度已宣布21天内“全面禁止”离家。南非派出军队协助执行封锁。这些措施可以减缓疾病的传播,但却不大可能阻止它。


Granted, there are some reasons for hope. Poor countries are young—the median age in Africa is under 20—and the young appear less likely to die from an infection. The poorest are very rural: two-thirds of people in countries with incomes per head below $1,000 a year live in the countryside, compared with less than a fifth in rich countries. Farmers can grow yams without breathing viral droplets on each other. The climate may help. It is possible, though far from certain, that hot weather slows the spread of covid-19. 

当然,还是有一些理由能让我们保持希望。贫穷的国家都很年轻-非洲的中位年龄在20岁以下-年轻人死于感染的可能性似乎较小。最穷的人是农村人:年人均收入低于1000美元的国家中有三分之二的人生活在农村,而富裕国家中只有不到五分之一。农民在种植山药的时候不会彼此吸入病毒飞沫。气候可能会有所帮助。尽管不能确定,但炎热的天气有可能减慢covid-19的传播速度。 

  • yam 山药

  • viral droplet 病毒飞沫


Alas, even the good news comes with caveats. People in poor countries may be young, but they often have weak lungs or immune systems, because of malnutrition, tuberculosis or hiv. Lockdowns will be hard to sustain unless governments can provide a generous safety-net. Firms need credit to avoid laying off staff. Informal workers need cash to tide them over. Unfortunately, poor countries do not have the financial muscle to provide these things, and covid-19 has just made it much harder.

但是,这个好消息还伴随着警告。贫穷国家的人们可能还很年轻,但是由于营养不良,结核病或艾滋病毒,他们的肺部或免疫系统往往很弱。 除非政府能够提供一张广阔的安全网,否则很难维持封锁。企业需要信贷以避免裁员。非正式工人需要现金来度过难关。不幸的是,贫穷国家没有财力来提供这些东西,而covid-19则让情况雪上加霜。

  • tide sb over sth 帮助某人渡过难关,类似表达:  weather the storm , pull through sth.

  • financial muscle 财力。muscle本指肌肉,在这里引申为对某种东西的力量,实力。