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

UP Lecture 20

UP Lecture 20

Compilers
Second Midterm Review
(202504)

Javier Gonzalez-Sanchez

December 23, 2023
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

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

    We Now? Language Analysis Lexical Rules Input: Symbols Output: Words Syntaxl Rules Input: Words Output: Sentences Semantic Input: Sentences Translate or Execute Virtual Machine
  2. Dr. Javier Gonzalez-Sanchez | Compilers | 8 jgs Question Give

    a parse tree for the string @1#2#(3#@4)
  3. Dr. Javier Gonzalez-Sanchez | Compilers | 11 jgs Validate Properly

    Formatted References Jafet Rodriguez, Carolina Del-Valle-Soto, and Javier Gonzalez-Sanchez. 2024. Affect-Driven VR Environment for Assisted Gait Rehabilitation. IEEE Access. IEEE. 1303-1312.
  4. Dr. Javier Gonzalez-Sanchez | Compilers | 12 jgs Validate Properly

    Formatted References Jafet Rodriguez, Carolina Del-Valle-Soto, and Javier Gonzalez-Sanchez. 2024. Affect-Driven VR Environment for Assisted Gait Rehabilitation. IEEE Access. IEEE. 1303-1312.
  5. Dr. Javier Gonzalez-Sanchez | Compilers | 13 jgs Question |

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

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

    Syntax Analysis Create a grammar to validate properly formatted references. a) Diagrams b) BNF/EBNF
  8. Dr. Javier Gonzalez-Sanchez | Compilers | 16 jgs Validate Properly

    Formatted References Non-terminals <REFERENCE> <AUTORS> <YEAR> <TITLE> <CONFERENCE> <PUBLISHER> <PAGES> Terminals string number . , -
  9. Dr. Javier Gonzalez-Sanchez | Compilers | 17 jgs Validate Properly

    Formatted References | Syntax Diagram <REFERENCE> → <AUTORS> → <YEAR> → <TITLE> → <CONFERENCE> → <PUBLISHER> → <PAGES> →
  10. Dr. Javier Gonzalez-Sanchez | Compilers | 18 jgs Validate Properly

    Formatted References | BNF/EBNF <REFERENCE> → <AUTORS> → <YEAR> → <TITLE> → <CONFERENCE> → <PUBLISHER> → <ADDRRESS> → <PAGES> →
  11. Dr. Javier Gonzalez-Sanchez | Compilers | 21 jgs Validate Properly

    Formatted References | Derivation Tree reference
  12. Dr. Javier Gonzalez-Sanchez | Compilers | 24 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; }
  13. Dr. Javier Gonzalez-Sanchez | Compilers | 25 jgs Question |

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

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

    Syntax Analysis Create a grammar to validate properly formatted CSS Code. a) Diagrams b) BNF/EBNF
  16. Dr. Javier Gonzalez-Sanchez | Compilers | 34 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 ;
  17. Dr. Javier Gonzalez-Sanchez | Compilers | 35 jgs Question |

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

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

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