Mid-Terms Exam Scope and Introduction
Format Grades: 100 points -> 20% in the final grade Multiple Choice Questions –8 questions, 7 points each Short Answer Questions –4 questions, 44 points total
Ways to read the slides * must be covered in mid-term Other: may be covered in mid-term Not mentioned: Not covered in mid-term
Compiler Introduction Input and Output of a compiler *Difference between interpreters and compilers Structure of a compiler: Basic components Why split to front ends and back ends?
Formal Languages: Basics *Terminology: alphabets, sentence, template sentence, derivations, terminal, non-terminals, productions, … Four-tuple definition of PSG Language of a grammar and inductive proof on the language of a grammar Chomsky hierarchy of languages
Context Free Grammar What is a Derivation Tree Ambiguities in Derivation: identify ambiguity by giving sentence examples Conversion to Chomsky Normal Forms CYK Algorithm Read and understand BNF grammars
Finite State Machines Definition of DFA and NFA *How an input string is processed in a DFA and an NFA, and whether it is accepted or not
Lexical Analysis Type of tokens Attributes of tokens *Create an acceptance model for a given token (represented as a regular expression) Two buffer strategy What are lexical errors
Parsing - LL1 What is recursive descent parsing? Remove Left Recursion and Left Refactoring *Parsing Table Calculation –Calculation of First Sets –Calculation of Follow Sets –Calculation of Parsing Tables *How to perform parsing given a parsing table
Parsing - LR Identification of LR items and calculate closures Draw LR state automatons Fill in LR parsing tables