1. Compiler Construction
    1. Lexing
    2. Parsing
      1. Top-Down
      2. Bottom-Up
    3. Semantic Analysis
    4. Code Synthesis

Maximilian Stark (mail@dakror.de), SS2020

Stand: 18.07.2020

Compiler Construction

General compiler setup

  1. Analysis
    • Scanner
      • Tokenization
      • Siever
        • Filtering of tokens (spaces, comments)
        • Collecting pragmas
        • Token-Replacements (Constants, names)
        • In practice: User-Code Callbacks per token type
      • Generated by specification
    • Parser
      • Generated by specification
        • hierarchical structure = context-free grammar
        • Pushdown-Automata
    • Type Checker
  2. Internal Representation
  3. Synthesis

Lexing

From Regex to NFA

From NFA to DFA: Powerset-Construction

Scanner Design

Parsing

Context-free grammar

Top-Down

Pushdown-Automata

Lookahead Sets

Right-Regular Context-Free Parsing (RR-CFG)

Recursive Descent RLL Parsers

Bottom-Up

Shift-Reduce Parsers

Characteristic Automation $c(G)$ of $G$

Canonical $LR(0)$-Automaton

$LR(0)$-Parser

$LR(1)$-Parser

$LR(k)$ to $LR(1)$

Semantic Analysis

Attribute Grammars

Strongly Acyclic Grammar

From dependencies to evaluation strategies

Type Checking

Code Synthesis

Register C-Machine (RCMa)

Translation