Content text lecture06.pdf
Prof. Aiken CS 143 Lecture 6 1 Error Handling Syntax-Directed Translation Recursive Descent Parsing Lecture 6
Prof. Aiken CS 143 Lecture 6 2 Announcements • PA1 – Due today at midnight – README, test case – Your name(s)! • WA1 – Due today at 5pm • PA2 – Assigned today • WA2 – Assigned today
Prof. Aiken CS 143 Lecture 6 4 Error Handling • Purpose of the compiler is – To detect non-valid programs – To translate the valid ones • Many kinds of possible errors (e.g. in C) Error kind Example Detected by ... Lexical ... $ ... Lexer Syntax ... x *% ... Parser Semantic ... int x; y = x(3); ... Type checker Correctness your favorite program Tester/User