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

UP Lecture 16

UP Lecture 16

Compilers
Parser III
(202503)

Javier Gonzalez-Sanchez

December 19, 2023
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. Dr. Javier Gonzalez-Sanchez | Compilers | 18 jgs KEYWORD {class,

    return, print} STRING Language Actions Expressions (operators) Instructions Control Structures ARITHMETIC OPERATORS { +, -, *, /, =} LOGIC OPERATORS { &, |, ! } RELATIONAL OPERATORS {<, >, ==, !=, <=, >=} KEYWORD { if, else, do, while, for, switch, case } Data INTEGER FLOAT HEXADECIMAL CHAR KEYWORD { void, int, char, string, float, boolean } KEYWORD { true, false } BINARY Delimiter : ; , ( ) { } [ ] Our Language OCTAL IDENTIFIER
  2. Dr. Javier Gonzalez-Sanchez | Compilers | 20 jgs Our Grammar

    What about global variables? 1. PROGRAM
  3. Dr. Javier Gonzalez-Sanchez | Compilers | 23 jgs Our Grammar

    5. PARAMS 6. ASSIGNMENT 7. EXPRESSION
  4. Dr. Javier Gonzalez-Sanchez | Compilers | 26 jgs Our Grammar

    14. C What about call a method and use the returned value?
  5. Dr. Javier Gonzalez-Sanchez | Compilers | 28 jgs Our Grammar

    19, CALL_METHOD 20. PARAM_VALUES 18. RETURN
  6. 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.