1 / 4

Ch7. Programming Language and Systems An Introduction to Informatics

Ch7. Programming Language and Systems An Introduction to Informatics. 2008. 12. 1 In-Bon Kuh GNU OSLab. Source Program. Lexical Analysis. Tokens. Symbol Tables. Syntax Analysis. Intermediate Form. Code Generation. Target Program. < Compiler Phases >. ... ...

kiefer
Download Presentation

Ch7. Programming Language and Systems An Introduction to Informatics

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. Ch7. Programming Languageand SystemsAn Introduction to Informatics 2008. 12. 1 In-Bon Kuh GNU OSLab.

  2. Source Program Lexical Analysis Tokens SymbolTables Syntax Analysis Intermediate Form Code Generation Target Program < Compiler Phases > An Introduction to Informatics

  3. ... ... ifb = 15 thenx := (a + c) / xelsey := x ... ... ... ... LD B AC  B SUB N15 AC  AC - 15 BNZ L5 Go to else part, if AC ≠ 0 LD A AC  A ADD C AC  AC + C DIV X AC  AC / X (quotient) ST X X  AC B L6 Go to the end of statement L5 LD X AC  X ST Y Y  X L6 ... ... Compiler < Example of Source and Object Statements > An Introduction to Informatics

  4. b, 15, = {Polish postfix of Boolean expression} IFJUMPL1 {Transfer on false.} x, a, c, +, x, /, := {True part of statement} JUMP L2 {Transfer of end of statement} L1: y, x, := {False part of statement} L2: 1: (=, b, 15, T1) {T1 (b = 15)} 2: (BNZ, T1, 6) {ifT1≠ 0 thengotoquadruple 6} 3: (+, a, c, T2) {T2  a + c} 4: (/, T2, x, x) {x  T2 / x} 5: (BR, 7, ,) {gotoquadruple 7} 6: (ST, y, x,) {y  x} 7: < Postfix Form > < Quadruples > An Introduction to Informatics

More Related