cSc 453 Compilers & Systems software
This content provides a comprehensive overview of CSc.453 course on compilers and systems software, covering topics such as compiler design, language translation, program implementation at the machine level, and software project experience. It delves into the structure of compilers, phases involved in compilation process, and the grouping of phases across front-end and back-end processes.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
CSc 453 Compilers & Systems Software Saumya Debray The University of Arizona Tucson, AZ 85721
Course Objectives Understand the design and implementation of compilers and related systems software. Understand how source language programs are implemented at the machine level. Understand compilation as an instance of language translation. + Get experience with a large software project CSc 453: Background 2
Compilers A compiler (more generally, translator) maps source language strings to equivalent target language strings. E.g.: gcc : C/C++ programs to assembly/machine code f2c : Fortran programs to C programs latex2html: Latex documents to HTML documents javac : Java programs to JVM byte code ps2pdf: PostScript files to PDF files CSc 453: Background 3
Languages Syntax: structural aspects of program units. specified by a grammar. Semantics: the meaning, i.e., behavior, of program units. specified using actions associated with grammar rules. CSc 453: Background 4
Structure of a compiler (phases) CSc 453: Background 5
Structure of a compiler (phases) CSc 453: Background 6
Structure of a compiler (phases) Front end Back end CSc 453: Background 7
Phases of a Compiler Lexical analysis ( scanning ) Reads in program, groups characters into tokens Syntax analysis ( parsing ) Structures token sequence according to grammar rules of the language. Semantic analysis Checks semantic constraints of the language. Intermediate code generation Translates to lower level representation. Program analysis and code optimization Improves code quality. Final code generation. 1. 2. 3. 4. 5. 6. CSc 453: Background 8
Grouping of Phases Front end : machine independent phases Lexical analysis Syntax analysis Semantic analysis Intermediate code generation Some code optimization Back end : machine dependent phases Final code generation Machine-dependent optimizations CSc 453: Background 9
A very commonly used translator: The Web Browser Webkit (rendering engine for Safari and Chrome): Gecko (rendering engine for Firefox): back end front end front end back end Source: How Browsers Work: Behind the Scenes of Modern Web Browsers, by Tali Garsiel & Paul Irish. http://www.html5rocks.com/en/tutorials/internals/howbrowserswork/ CSc 453: Background 10
Costs of different phases Typically, a compiler spends most of its time doing I/O and lexical analysis: ~ 35-40% of time spent in I/O ~ 30% in lexical analysis ~ 10% in symbol table management ~ 7-15% in parsing and other control CSc 453: Background 11