L17 ebp 842 back end assign idy idy int42 uw

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: e 1 Lecture 1 of program. L hat conveys meaning Course •  Most common is an abstract syntax tree (“AST”) Course Mechanics Mechanics –  Essen7al L eaning of pBindings rogram without syntac7c M m Variable ML Variable Bindings noise –  Nodes are opera7ons, children are operands Dan Grossman •  E.g., 1 + 1 – Darent: +, Child1: 1, Child2: 1 P an Grossman Fall 2011 Fall 2011 1 + 1 •  Many different forms of IR used in compilers –  Engineering tradeoffs have changed over 7me –  Tradeoffs (and IRs) also can vary between different phases of compila7on. Winter 2013 UW CSE 401 (Michael Ringenburg) A-24 Parser Example // Look, I wrote a comment! if (x >= y) y = 42;! •  Token Stream Input IF LPAREN RPAREN GEQ ID(y) INT(42) Winter 2013 •  Abstract Syntax Tree ID(x) ID(y) I’m a good programmer!! BECOMES SCOLON ifStmt >= ID(x) UW CSE 401 (Michael Ringenburg) assign ID(y) ID(y) INT(42) A-25 Sta7c Seman7c Analysis CSE341: Programming CSE341: Programming Languages Languages •  During and/or aver parsing, checks that Lecture 1 Lecture 1 program is legal, and collects info for back end Course Course Mechanics Mechanics –  Type checking ML Variable Bindings ML Variable Bindings like proper –  Check language requirements declara7ons/ini7al...
View Full Document

This document was uploaded on 04/04/2014.

Ask a homework question - tutors are online