1 / 7

Welcome to CS 445 Compiler and Translator Design

Welcome to CS 445 Compiler and Translator Design. Clinton Jeffery jeffery@uidaho.edu JEB 230. What’s a Compiler. Translates human equations to machine code Originally done by a human

harper
Download Presentation

Welcome to CS 445 Compiler and Translator Design

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. Welcome to CS 445Compiler and Translator Design Clinton Jeffery jeffery@uidaho.edu JEB 230

  2. What’s a Compiler • Translates human equations to machine code • Originally done by a human • Compared with colloquial English: to pull together the sequence of machine instructions needed to perform a given computing task

  3. Why Study Compilers? • Experience with large-scale applications development. • A shining triumph of CS theory • A basic element of language R&D • Ideas and tools useful in many applications

  4. Tools We Use • C and “make” • Lex and Yacc • Gdb • E-mail • Web • CVE

  5. Kinds of Compilers • Native code • Virtual machine • JIT • Preprocessor, macro processor • Interpreter

  6. Phases of a Compiler • Lexical analysis • Syntax Analysis • Semantic Analysis • Intermediate Code Generation • Optimization • Final Code Generation • Linking

  7. Example • Compile: position = initial + rate * 60 • Intermediate: t1 = inttoreal(60) t2 = id3 * t1 t3 = id2 + t2 id1 = t3 • Final: MOVF id3, R2 MULF #60.0, R2 MOVF id2, R1 ADDF R2, R1 MOVF R1, id1

More Related