1 / 8

CSc 453 Compilers & Systems Software

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.

yoshi
Download Presentation

CSc 453 Compilers & Systems Software

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSc 453Compilers & Systems Software Saumya Debray The University of Arizona Tucson, AZ 85721

  2. 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. CSc 453: Background

  3. 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

  4. 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

  5. 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. CSc 453: Background

  6. 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

  7. A very commonly used translator:The Web Browser Gecko (rendering engine for Firefox): Webkit (rendering engine for Safari and Chrome): back end front end front end back end Source: How Browsers Work: Behind the Scenes of Modern Web Browsers, by TaliGarsiel & Paul Irish. http://www.html5rocks.com/en/tutorials/internals/howbrowserswork/ CSc 453: Background

  8. 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

More Related