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

UP Lecture 02

UP Lecture 02

Compilers
Languages
(202401)

Javier Gonzalez-Sanchez

December 05, 2023
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. Dr. Javier Gonzalez-Sanchez | Compilers | 5 jgs Keywords Level

    Paradigm Language Analysis (verify) Lexical Input: Symbols Output: Words Syntax Input: Words Output: Sentences Semantic Input: Sentences Translate or Execute
  2. Dr. Javier Gonzalez-Sanchez | Compilers | 10 jgs Language Levels

    Hardware Machine Language Assembly Language High-Level Language C Fortran C++ Java
  3. Dr. Javier Gonzalez-Sanchez | Compilers | 11 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) // sorce code int x; int foo () { read (x); print (5); } main () { foo (); } Lexer Parser Semantic Analyzer Code Generation 01001010101000010 01010100101010010 10100100000011011 11010010110101111 00010010101010010 10101001010101011 Assembler compilation execution
  4. Dr. Javier Gonzalez-Sanchez | Compilers | 13 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) // sorce code int x; int foo () { read (x); print (5); } main () { foo (); } Lexer Parser Semantic Analyzer Code Generation 01001010101000010 01010100101010010 10100100000011011 11010010110101111 00010010101010010 10101001010101011 Assembler compilation execution
  5. Dr. Javier Gonzalez-Sanchez | Compilers | 15 jgs Lexical Analysis

    int x = 5; float y = "hello; String @z = "9.5"; int x = cse340; if ( x > 14) while (5 == 5) if (int a) a = 1; x = x; for ( ; ; ); y = 13.45.0; int me = 99999000001111222000000111111222223443483045830948; while { x != 9} (); int {x} = 10;
  6. Dr. Javier Gonzalez-Sanchez | Compilers | 16 jgs Let’s Work

    How many strings (words), and what is the token for each? Are there errors?
  7. Dr. Javier Gonzalez-Sanchez | Compilers | 17 jgs Homework Review

    the following topics: Regular Expressions (Text Book: Chapter 6) and Deterministic Finite Automata
  8. jgs Compilers Javier Gonzalez-Sanchez, Ph.D. [email protected] Spring 2024 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.