June 18, 2022 1 June 18, 2022 June 18, 2022 Azusa, Azusa, CA CA Sheldon X. Liang Ph. D. Computer Science at Computer Science at Azusa Azusa Pacific University Pacific University Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/ CS400 Compiler Construction CS400 Compiler Construction
12
Embed
September 7, 2015 1 September 7, 2015September 7, 2015September 7, 2015 Azusa, CA Sheldon X. Liang Ph. D. Computer Science at Azusa Pacific University.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
April 19, 20231
April 19, 2023April 19, 2023 Azusa, CAAzusa, CA
Sheldon X. Liang Ph. D.
Computer Science at Computer Science at Azusa Pacific UniversityAzusa Pacific University
Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/
CS400 Compiler ConstructionCS400 Compiler Construction
• Compiler front and back ends:– Front end: analysis (machine independent)
– Back end: synthesis (machine dependent)
• Compiler passes:– A collection of phases is done only once (single pass)
or multiple times (multi pass)• Single pass: usually requires everything to be defined before
being used in source program
• Multi pass: compiler may have to keep entire program representation in memory
April 19, 20239
Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/
The Grouping of PhasesThe Grouping of Phases
CS@APU: CS400 Compiler ConstructionCS@APU: CS400 Compiler Construction
• Software development tools are available to implement one or more compiler phases– Scanner generators– Parser generators– Syntax-directed translation engines– Automatic code generators– Data-flow engines
April 19, 202310
Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/