Upgrade to Pro — share decks privately, control downloads, hide ads and more …

UP Lecture 30

UP Lecture 30

Compilers
Final Review
(202505)

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. Dr. Javier Gonzalez-Sanchez | Compilers | 2 jgs jgs GitHub

    Classroom ▪ Final Project https://classroom.github.com/a/XJmZgSI2 ▪ TheCompiler ▪ Your final project ▪ Include Lexer ▪ Include Parser with error handling ▪ Include Semantic Analysis ▪ Include Code Generation ▪ Bonus: your generated code work with the provided VM
  2. Dr. Javier Gonzalez-Sanchez | Compilers | 3 jgs jgs To

    Do List ▪ Source Code on your GitHub Repository (submit a link) ▪ Final Paper (document) ▪ Video Presentation (submit a link) ▪ Final Exam (yes!, we will have a review)
  3. Dr. Javier Gonzalez-Sanchez | Compilers | 4 jgs jgs Extra

    ▪ How to do a Virtual Machine ▪ Second Part of code Generation (loops, conditions, methods)
  4. Dr. Javier Gonzalez-Sanchez | Compilers | 6 jgs jgs High-Level

    Languages X,E,G,O,O #e1,I,I,0,7 @ OPR 19, AX STO x, AX LIT 5, AX OPR 21, AX LOD #e1,AX CAL 1, AX OPR 0, AX 5 Virtual Machine (interpreter) // source code Lexer Parser Semantic Analyzer Code Generation 01001010101000010 01010100101010010 10100100000011011 11010010110101111 00010010101010010 10101001010101011 Assembler compilation execution
  5. Dr. Javier Gonzalez-Sanchez | Compilers | 13 jgs jgs Example

    ▪ https://tabatkins.github.io/railroad-diagrams/generator.html
  6. Dr. Javier Gonzalez-Sanchez | Compilers | 14 jgs jgs Example

    ▪ https://www.graphviz.org/pdf/neatoguide.pdf
  7. Dr. Javier Gonzalez-Sanchez | Compilers | 15 jgs jgs LISP

    (defun factorial (n) (if (<= n 0) 1 (* n (factorial (- n 1))) ) ) FACTORIAL (factorial 1000) result? … double factorial (double n) { if (n<=1) return 1; else return n * factorial (n-1); } result?
  8. jgs jgs Compilers Javier Gonzalez-Sanchez, Ph.D. [email protected] Spring 2025 Copyright.

    These slides can only be used as study material for the Compilers course at Universidad Panamericana. They cannot be distributed or used for another purpose.