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

UP Lecture 20

UP Lecture 20

Compilers
Second Midterm Review II
(202504)

Javier Gonzalez-Sanchez PRO

December 23, 2023

Transcript

30 slides
  1. Dr. Javier Gonzalez-Sanchez | Compilers | 2 jgs Where Are

    We Now? Language Analysis Lexical Rules Input: Symbols Output: Words Syntaxis Rules Input: Words Output: Sentences Semantic Input: Sentences Translate or Execute Virtual Machine
  2. Dr. Javier Gonzalez-Sanchez | Compilers | 3 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.
  3. Dr. Javier Gonzalez-Sanchez | Compilers | 10 jgs Validate Properly

    Formatted CSS Code body, html { margin: 0; padding: 0; font-family: sans-serif; } h1 { background-color: #333; color: white; } p { font-size: 14px; }
  4. Dr. Javier Gonzalez-Sanchez | Compilers | 11 jgs Question |

    Lexical Analysis How many terminals (tokens)? Which are terminals (tokens)?
  5. Dr. Javier Gonzalez-Sanchez | Compilers | 12 jgs Question |

    Lexical Analysis Create a DFA (transition table) for each identified token (terminal).
  6. Dr. Javier Gonzalez-Sanchez | Compilers | 13 jgs Question |

    Syntax Analysis Create a grammar to validate properly formatted CSS Code. a) Diagrams b) BNF/EBNF
  7. Dr. Javier Gonzalez-Sanchez | Compilers | 22 jgs Exam |

    Review select nombre, calificacion from estudiantes where id = 1; insert into estudiantes ( id, nombre, calificacion ) values ( 10, ”Javier”, 90 ) ; delete from table where calificacion = 90 ;
  8. Dr. Javier Gonzalez-Sanchez | Compilers | 23 jgs Question |

    Lexical Analysis How many terminals (tokens)? Which are terminals (tokens)?
  9. Dr. Javier Gonzalez-Sanchez | Compilers | 24 jgs Question |

    Lexical Analysis Create a DFA (transition table) for each identified token (terminal).
  10. Dr. Javier Gonzalez-Sanchez | Compilers | 25 jgs Question |

    Syntax Analysis Create a grammar to validate properly formatted SQL (only the examples). a) Diagrams b) BNF/EBNF
  11. 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.

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming