Assorted AnnouncementCourse SummaryProgramming LanguagesTranslation of Programming LanuagesTranslation of Programming Languages, contd.ToolsConstruction of Complex SoftwareParting RemarksAssorted Announcement• HKN Survey at end of lecture.• Project due Monday. Autograder sometime tonight.• Final: Tuesday, 19 May at 5–8PM in 277 Cory• Review session: TBALast modified: Thu May 7 01:43:48 2009 CS164: Lecture #30 1Course Summary• Programming Languages• Translation of Programming Languages• Tools• Construction of Complex SoftwareLast modified: Thu May 7 01:43:48 2009 CS164: Lecture #30 2Programming Languages• Scope of declarations• Scope vs. extent (lifetime) of variables• Interactions between language design and runtime structures:– Function representation∗ Effects of recursion, variable-sized data, functional values– Inheritance∗ Single vs. multiple inheritance∗ Java-style interfaces• Formal methods for describing languages: type systems• Specific languages used here: Prolog, Python, C++.Last modified: Thu May 7 01:43:48 2009 CS164: Lecture #30 3Translation of Programming Lanuages• Lexical analysis– regular expressions, finite automata• Context-free syntax– BNF– Top-down, recursive descent– Bottom-up, shift-reduce parsing– Terminology: derivation– Syntax-driven translation• Static semantics– Symbol tables, relation to environment diagrams– Types, type inferenceLast modified: Thu May 7 01:43:48 2009 CS164: Lecture #30 4Translation of Programming Languages, contd.• Code generation, intermediate forms• Runtime representations for “special effects”– Exceptions– Procedure calls– Object-oriented method dispatch– Garbage collection• Optimization– Terminology: basic blocks, control-flow graph– “Classical” optimizations– Structure of flow analysisLast modified: Thu May 7 01:43:48 2009 CS164: Lecture #30 5Tools• Lexer-generation, use of regular expressions and states• Parser generators, rule-based programming• Version-control conceptsLast modified: Thu May 7 01:43:48 2009 CS164: Lecture #30 6Construction of Complex Software• Be familiar with project, including parts you didn’t write.• Concept of a “pass” or “phase”.• Use of object-orientation to partition task• Importance of intermediate forms; how used to reduce work ofporting compilersLast modified: Thu May 7 01:43:48 2009 CS164: Lecture #30 7Parting Remarks• It’s not just compilers:– Ideas in this course are general-purpose tools– Think domain-specific languages• Opportunities for research– Parallelism and distributed computation– Static program analysisLast modified: Thu May 7 01:43:48 2009 CS164: Lecture #30
View Full Document