目录

  • 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 实施方案
The beat of a heart the glimmer of a soul

特朗普还有人性吗?

 来源:  NYT双语阅读

(本文为时报专栏,作者是Frank Bruni。
Do you remember President George W. Bush’s remarks at Ground Zero in Manhattan after the Sept. 11 terrorist attacks? I can still hear him speaking of national grief and national pride. This was before all the awful judgment calls and fatal mistakes, and it doesn’t excuse them. But it mattered, because it reassured us that our country’s leader was navigating some of the same emotional currents that we were.
你记得9·11恐怖袭击事件发生后,乔治·W·布什总统在曼哈顿世贸中心废墟发表的讲话吗?我现在还清楚地记得他提到国家的悲伤和民族自豪时的声音。这是在后来的所有糟糕判断和致命错误之前,这并不能为那些判断和错误开脱。但这个讲话很重要,因为它让我们确信,我们国家的领导人脑海里翻腾着一些与我们一样的情感思潮。
Do you remember President Barack Obama’s news conference after the school shooting in Newtown, Conn., that left 28 people, including 20 children, dead? I do. Freshest in my memory is how he fought back tears. He was hurting. He cared. And while we couldn’t bank on new laws to prevent the next massacre, we could at least hold on to that.
你记得奥巴马总统在康涅狄格州纽敦校园枪击案发生后举行的记者会吗?那次枪击案导致了包括20名儿童在内的28人死亡。我记得。我记忆中最清晰的是他强忍住眼泪的情景。他伤心。他担忧。虽然我们不能指望用新法律来阻止下一次大屠杀,但我们至少可以继续保持希望。
One more question: Do you remember the moment when President Trump’s bearing and words made clear that he grasped not only the magnitude of this rapidly metastasizing pandemic but also our terror in the face of it?
还有一个问题:你记得有这样的时刻吗——特朗普总统的言行表明,他不仅理解这场迅速蔓延的大流行病的规模,也领会我们在其面前的恐惧?
It passed me by, maybe because it never happened.
我没有见到这个时刻,也许是因为它从未发生。
In Trump’s predecessors, for all their imperfections, I could sense the beat of a heart and see the glimmer of a soul. In him I can’t, and that fills me with a sorrow and a rage that I quite frankly don’t know what to do with.
在特朗普前任们的身上,尽管他们有各种疵瑕,但我能感觉到一颗跳动的心,看到一个微微闪光的灵魂。在特朗普身上我什么都感觉不到,这让我充满悲伤,也充满了一种坦白讲我不知道该怎么处理的暴怒。
Americans are dying by the thousands, and he gloats about what a huge, rapt television audience he has. They’re confronting financial ruin and not sure how they’ll continue to pay for food and shelter, and he reprimands governors for not treating him with adequate adulation.
成千的美国人正在死去,他却在洋洋得意地吹嘘自己有多么多全神贯注的电视观众。美国人面临着财务崩溃,不知道继续买食物、付房租的钱从哪里来,他却斥责州长们没有给予他足够的奉承。
He’s not rising to the challenge before him, not even a millimeter. He’s shriveling into nothingness.
他没有在挑战面前挺身而出,丝毫没有。他正在萎缩成一个不存在的东西。
On Friday, when Trump relayed a new recommendation by the Centers for Disease Control and Prevention that all Americans wear face masks in public places, he went so far out of his way to stress that the coverings were voluntary and that he himself wouldn’t be going anywhere near one that he might as well have branded them Apparel for Skittish Losers. I’ve finally settled on his epitaph: “Donald J. Trump, too cool for the coronavirus.”
上周五,在转达疾病控制和预防中心提出所有美国人在公共场所戴口罩的新建议时,特朗普格外努力地强调,戴口罩是自愿的,他本人就不会戴、身边也不会有人戴,这简直就等于给口罩贴上了“担惊受拍失败者才会戴”的标签。我终于为他想好了一个墓志铭:“唐纳德·J·特朗普,病毒面前仍耍酷”。
This is more than a failure of empathy, which is how many observers have described his deficiency. It’s more than a failure of decency, which has been my go-to lament. It’s a failure of basic humanity.
这不仅仅是同理心的缺失,尽管许多观察者都用这来描述他的缺点。这更多地是行为准则的缺失,也是我一直以来在悲叹的。这是基本人性的缺失。
In The Washington Post a few days ago, Michael Gerson, a conservative who worked in Bush’s White House, wrote that Trump’s spirit is “a vast, trackless wasteland.” Not exactly trackless. There are gaudy outposts of ego all along the horizon.
在几天前的《华盛顿邮报》上,曾在布什政府工作的保守派人士迈克尔·格尔森(Michael Gerson)写道,特朗普的精神世界是“一个巨大、无迹的荒原”。准确地说不是无迹。那里的地平线上到处都是自负的花哨俗艳。
When the direness of this global health crisis began to be apparent, I was braced for the falsehoods and misinformation that are Trump’s trademarks. I was girded for the incompetence that defines an administration with such contempt for proper procedure and for true expertise.
这场全球健康危机的严重性开始显现出来时,我已经准备好面对那些谎言和虚假信息,它们都是特朗普的招牌。我对无能也有所准备,这种无能定义了一个如此蔑视正确做法和真正专业知识的政府。
But what has taken me by surprise and torn me up inside are the aloofness, arrogance, pettiness, meanness, narcissism and solipsism that persist in Trump — that flourish in him — even during a once-in-a-lifetime emergency that demands something nobler. Under normal circumstances, these traits are galling. Under the current ones, they’re gutting.
但出乎我意料并令我心碎的是特朗普持续的,甚至是旺盛的冷漠、傲慢、小气、刻薄、自恋和唯我,即使是在需要有更高尚表现的这种一生可能只有一次的紧急情况下。在正常情况下,这些特点令人恼火。而在眼下,这些特点让人彻底崩溃。
“I don’t take responsibility at all.” “Did you know I was number one on Facebook?” To bother with just one of those sentences while a nation trembles is disgusting. To bother with both, as Trump did, is perverse.
“我完全不承担责任。”“你知道我在Facebook上排名第一吗?”在一个国家因恐慌而颤抖时,有心思说出这两句话中的一句就够令人作呕了。像特朗普这样说出两句,是不通人事。
He continues to bash the media, as if the virus were cooked up in the bowels of CNN. He continues to play blame games and to lord his station over those of a lesser political caste, turning governors into grovelers and suggesting that they’re whiny piggies at the federal trough.
他继续抨击媒体,仿佛新冠病毒是在CNN的内部炮制出来的。他继续玩推卸责任的游戏,把自己凌驾于那些政治等级低的人之上,他想让州长们对他卑躬屈膝,并暗示他们是在联邦政府饲料槽前嗷嗷争食的猪仔儿。
He continues his one-man orgy of self-congratulation, so that in the same breath recently he speculated about a toll of 100,000 deaths in America from Covid-19 and crowed about what a great job he’s doing.
他继续着他沾沾自喜的一人狂欢,所以会在最近一边推测美国将有10万人死于新冠病毒肺炎,一边扬扬自得地夸口自己正在做一份多么伟大的工作。
And he continues to taunt and smear his perceived political adversaries. Last week, on Fox News, he called Nancy Pelosi “a sick puppy.” This is how he chooses to spend his time and energy?
他继续奚落和诽谤他眼中的政治对手。上周,在福克斯新闻(Fox News)的节目上,他称南希·佩洛西(Nancy Pelosi)是“一只有病的小狗”。这就是他选择消磨时间和精力的方式吗?
At those beloved daily briefings of his, where he talks and talks and talks, he sometimes seems to regard what’s happening less as a devastating scourge than as a star-studded event. Just look at the nifty degree of prominence it’s conferring on everyone and everything involved! He has mused aloud about how well known Anthony Fauci has become. He has marveled at the disease’s celebrity profile.
他在深受其青睐的每日简报会上说起话来没完没了,有时,他似乎并不把正在发生的事情当作一场毁灭性的灾难,而是一场明星荟萃的活动。看看简报会给每个参加者和所涉及的事情带来了多么精彩的出头露面机会吧!他曾大声的自言自语,感慨安东尼·福奇(Anthony Fauci)出了多大的名。他赞叹新冠病毒肺炎享有的名人形象。
“Become a very famous term — C-O-V-I-D,” he said on Thursday. Was that envy in his voice?
“成了一个非常有名的词儿——新-冠-病-毒-肺-炎,”他周四说道。从他语音里听出了嫉妒吗?
He leaps from tone deafness to some realm of complete sensory and moral deprivation.
他从无视现实转入一个感官和道德完全丧失的境地。
“I want to come way under the models,” he said on Friday, referring to casualty projections. “The professionals did the models. I was never involved in a model.”
“我想要比模型低很多的数字,”他周五说,指的是病例和死亡人数的预测。“模型是专业人士做的。我从来没干过任何模型。”
“At least this kind of model,” he added. No context like a pandemic for X-rated humor.
“至少没干过这种,”他补充道。没有比大流行病更好的黄色幽默背景了。
It’s an extraordinary thing: to fill the air with so many words and have none of them carry any genuine sadness or stirring resolve.
做到这点真不容易:把这么多的厥词释放到空气中,却没有一个词承载任何真正的悲伤或打动人心的信念。
I can hear his admirers grumble that he doesn’t do camera-perfect emotions, that Obama was just a better actor, that Trump is the more authentic man.
我可以听到他的崇拜者们发牢骚说,特朗普不会在相机前做完美的情感表演,奥巴马只不过是一个更好的演员而已,特朗普则是一个更真实的人。
To which I answer: What’s the point of having a showman for a president if he can’t put on the right kind of show? Performances count, even if they’re just performances. And Trump clearly isn’t averse to artifice. Just look at his hair.
我对此的回答是:如果让一个喜欢表演的人当总统,但他却演不出好戏的话,那还有什么意义呢?表演很重要,即使只是表演。特朗普显然不反对道具。看看他的头发就知道了。
A cheap shot? I’m feeling cheap. A loss of life and livelihoods on this scale will do that to you.
这种攻击低劣吗?我正在感到低劣。这么大规模地失去生命和生计将让你产生这种感觉。
As of this writing, at least 9,600 people with the coronavirus have died in the United States. That’s more than three times the number killed in the Sept. 11 attacks. New York State alone reported 630 new deaths on Saturday. No school shooting has taken even a small fraction of as many lives.
我写这篇文章时,美国已至少有9600人死于新冠病毒。这是9·11恐怖袭击事件死亡人数的三倍多。仅纽约州在周六一天就通报了630例死亡。没有一起校园枪击案夺走的生命可以远远企及这个数字。
And while I’m not looking to Trump for any panacea, is it too much to ask for some sign that the dying has made an impression on him, that the crying has penetrated his carapace and that he’s thinking about something other than his ratings? I watch. I wait. I suspect I’ll be doing that forever.
虽然我不指望特朗普能提供什么灵丹妙药,但是,想看到有点迹象表明,这么多将死的人触动了他,哭声已经穿透了他的外壳,他在想除了自己的收视率以外的事情,不算太过分吧?我观察。我等待。我觉得我会永远这样做下去。


本文作者Frank Bruni自从1995年开始为时报工作,担任过许多不同的职位,包括白宫记者、罗马分社社长和首席餐厅评论家。2011年,他成为时报的专栏作家。他也是三本畅销书的作者。

翻译:Cindy Hao