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

UP Lecture 08

UP Lecture 08

Compilers
Partial Review
(202502)

Javier Gonzalez-Sanchez

December 11, 2023
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. Dr. Javier Gonzalez-Sanchez | Compilers | 3 jgs Do not

    forget 2 students without GitHub Classroom 2 teams without trying a submission
  2. Dr. Javier Gonzalez-Sanchez | Compilers | 4 jgs Exam 01

    Tuesday Feb 18 (5 to 6.30 pm) Blackboard – Online but Synchronous No lecture; solve your exam.
  3. Dr. Javier Gonzalez-Sanchez | Compilers | 5 jgs Disclaimer ▪

    The exam will include material from Lectures 01 to 07. ▪ This is NOT an exhaustive list of exam topics. ▪ This review covers only a subset of the material. ▪ The following slides provide examples related to selected topics. ▪ Be sure to review all lecture slides and course materials thoroughly.
  4. Dr. Javier Gonzalez-Sanchez | Compilers | 13 jgs Question For

    each case, indicate whether it is possible to generate a Deterministic Finite Automaton (DFA). 1. Can a DFA detect the balance of N parentheses in a string that contains N nested parentheses with any characters in between? 2. Is it possible for a DFA to recognize binary strings that contain an equal number of 0s and 1s, regardless of their order or sequence?
  5. Dr. Javier Gonzalez-Sanchez | Compilers | 16 jgs Where are

    we now? After lexical analysis, we have a series of tokens. But we can not: I. define a DFA matching all expressions with properly balanced parentheses. II. i.e., define a DFA matching all functions with properly nested block structure. void a () { b (c); for (;;) {a=(-(1+2)+5); } }
  6. Dr. Javier Gonzalez-Sanchez | Compilers | 17 jgs Next Step

     Lexical Analysis ☐ Syntactic Analysis
  7. 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.