Mar27 - CSE302: Compiler Design Instructor: Dr. Liang Cheng...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE302: Compiler Design Instructor: Dr. Liang Cheng Department of Computer Science and Engineering Lehigh University March 27, 2007
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Instructor: Dr. Liang Cheng CSE302: Compiler Design 03/27/07 Outline ± Recap ± General/Canonical LR(1) parsing ± Lookahead LR(1) / LALR(1) parsing ± Yacc ± Syntax-directed translation (Chapter 5) ± Summary and homework
Background image of page 2
Instructor: Dr. Liang Cheng CSE302: Compiler Design 03/27/07 Outline ± Recap ± General/Canonical LR(1) parsing ± Lookahead LR(1) / LALR(1) parsing ± Yacc ± Syntax-directed translation (Chapter 5) ± Summary and homework
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Instructor: Dr. Liang Cheng CSE302: Compiler Design 03/27/07 Yacc Introduction ± Yet Another Compiler-Compiler ± Public domain versions: Bison ± Take a specification file (grammar) and produce an output file for the parser ± Input: <filename>.y ± {definitions} ± %% ± {productions/rules} ± %% ± {auxiliary routines} ± Output: y.tab.c ± LALR parser
Background image of page 4
Instructor: Dr. Liang Cheng CSE302: Compiler Design 03/27/07 Definition Section ± Information about tokens, data types ± Any code that must go directly into the output file ± #include directives ± May be empty
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Instructor: Dr. Liang Cheng CSE302: Compiler Design 03/27/07 Production Section ± Grammar rules with action codes ± is replaced by : ± A semicolon ends each production
Background image of page 6
Instructor: Dr. Liang Cheng CSE302: Compiler Design 03/27/07 Auxiliary Routine Section ± Procedure and function declarations that are needed to complete the parser ± May be empty
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Instructor: Dr. Liang Cheng
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/06/2008 for the course CSE 302 taught by Professor Cheng during the Spring '07 term at Lehigh University .

Page1 / 22

Mar27 - CSE302: Compiler Design Instructor: Dr. Liang Cheng...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online