4th Workshop - PowerPoint PPT Presentation

About This Presentation
Title:

4th Workshop

Description:

KJC/Kopi and IBM Jikes: open source full (-) java compilers and VM written in java/C ... Microsoft Rotor edu' C# compiler and .NET runtime written in C# (complex ... – PowerPoint PPT presentation

Number of Views:39
Avg rating:3.0/5.0
Slides: 18
Provided by: DB262
Category:
Tags: 4th | microsoft | vm | workshop

less

Transcript and Presenter's Notes

Title: 4th Workshop


1
About the structure of a compiler construction
course
  • Dragan Bojic ETF Belgrade
  • With credits to Zoran Budimac

2
Summary of Answers to the Questionnaire Ber,
NS, Bg
  • Relation to the corresponding course
  • 2 Already teach the corresponding course
  • 1 Do not teach, but willing to participate in
    creation of joint course materials

3
Summary of Answers...
  • Lecturers availability and willingness
  • to CREATE joint teaching materials
  • 2 very good
  • 1 fair
  • to USE joint teaching materials
  • 3 very good

4
Summary of Answers...
  • Place of the course in the curriculum
  • BER 3rd semester, 60 30 hours, 150 students
  • NS 78 semester, 60 ? Hours
  • BG 78 semester, 70 56 hours, 90 students

5
Summary of Answers...
  • Methodology, exams, and grade
  • BER students required to finish a practical
    project
  • NS before written oral exam
  • now pass if regular practical work,
    otherwise oral exam
  • BG obligatory practical homework (one time)
    written oral exam

6
SummaryTeaching Materials
  • Sources of the course contents and materials
  • 1 - almost completely my own
  • 1 - partly my own and partly taken from several
    sources
  • 1 - almost completely rely on the specific
    literature
  • Availability of teaching materials
  • 3 electronic form (in German or in Serbian)

7
SummaryTopics
  • Note NS and BER have basically the same
    curriculum and are using the case study to drive
    the course. Other topics (independent of the case
    study) are also covered (other methods of Syntax
    analysis, for example). On the other hand, Bg
    curriculum is mostly theoretical and covers more
    concepts.

8
SummaryTopics
  • NS and B
  • Overview Fundamentals, subtasks of a compiler,
    pass structures
  • Elements of automata theory and formal language
    theory, incl. grammars
  • Introduction to the prog. language used in case
    study
  • Lexical analysis
  • Syntax analysis LL(1), Recursive descent, LL(K),
    LR(K)
  • Semantic analysis (and symbol tables)
  • Definition of the target language (virtual
    machine) and code interpretation
  • Code generation
  • Elements of code optimization

9
SummaryTopics
  • Belgrade
  • Lexical analysis
  • Finite state automata.
  • Regular expressions.
  • Deterministic and non-deterministic automata.
  • Minimization of automata.
  • Automata implementation techniques.
  • Keyword recognition techniques.
  • Lexical analyzer generators.
  • Context free grammars.
  • Formal languages and grammars.
  • Grammar transformations.
  • Ambiguous grammars.
  • Regular and right-linear grammars.
  • Pushdown automata.
  • Translation.
  • Cycling.

10
SummaryTopics
  • Belgrade ()
  • Syntax directed translation.
  • attributive-translation grammars.
  • Top-down analysis.
  • Parser construction for S, Q and LL(1) grammars.
  • Error recovery.
  • Recursive descent method.
  • Parser construction for L attributive
    translation grammars.
  • Bottom-up analysis.
  • Shift-identify parsers.
  • Shift-reduce parsers.
  • Error recovery.
  • LR i SLR grammars.
  • Processing of S attributive translation
    grammars.

11
SummaryTopics
  • Belgrade ()
  • Run time environment.
  • Memory allocation strategies.
  • Activation records.
  • Static scope with and without procedure nesting.
  • Access links and Displays.
  • Dynamic scope.
  • Parameter passing mechanisms.
  • Construction of symbol tables.
  • Equivalence trees.
  • Code generation.
  • Selection of instructions
  • Register allocation.
  • Basic blocks and flow graphs.
  • Basic block transformations.
  • Simple code generator.

12
SummaryCase Studies
  • BER Pascal to P Code Compiler written in C (2500
    LOC).
  • There is also Java implementation with visual
    components.
  • NS Pascal compiler written in Modula 2
    (translation of the original Pascal
    implementation from Hansen)
  • BG Small parts of Ada/CS compiler written in ADA
    from LeBlanc. Small parts of sampleC compiler
    written in C from Schreiner et al. Small parts
    of Basic Interpreter from Lewis et al.

13
SummaryRecommended Literature
  • BER ?
  • NS
  • 1. B. Hansen On Pascal Compilers,
    Prentice-Hall, 1985.
  • 2. J.P.Tremblay, P.G.Sorenson The Theory and
    Practice of Compiler Writing, John Wiley Sons,
    1985.
  • BG
  • 1. P.M. Lewis, D. J. Rosenkrantz, R.E. Stearns,
    Compiler Design Theory, Addison-Wesley, 1976.
  • 2. A. R. Sethi, J.D. Ullman, Compilers/Principles,
    Techniques and Tools, Addison-Wesley, 1986
  • C. Fischer, R. LeBlanc, Crafting a Compiler,
    Benjaming-Cummings 1988
  • A. Schreiner, H.G. Friedman, Introduction to
    Compiler Construction with UNIX, Prentice-Hall,
    1985

14
SummaryImprovements
  • BER
  • New topics translation of OO constructs,
    optimizations
  • New case study (input language should not be
    Pascal)
  • NS
  • To add more theory
  • New case study (Java as an implementation
    language)
  • To make course more interesting to students
  • BG
  • To add a complete case study
  • To omit some topics, to add new about OO
    constructs
  • To make course more interesting to students
    (pure theoretical approach not very attractive)

15
Possible path to the Joint Course
  • JCCC should be based on particular compiler as
    case study ( of lectures) and other theoretical
    parts not related to the case study
  • Transition path for BER and NS to JCCC
  • Change of case study
  • Introduction of some new theoretical topics
  • Transition path for BG to JCCC
  • Introduction of complete case study
  • Less theory, more practical approach

16
Candidates for a new Case Study
  • desirable
  • Real life input languages and educational
    languages ()
  • Object-orientation in the input language (),
    and/or OO in compiler implementation
  • Contemporary implementation language ()

17
Candidates for a new Case Study
  • KJC/Kopi and IBM Jikes open source full (-) java
    compilers and VM written in java/C
  • Tiger edu, nonOO (-)target language, impl in
    Java, good book(), funct. Style (-)
  • Microsoft Rotor edu C compiler and .NET
    runtime written in C (complex -)
  • microJava prof. Mössenböck, Univ. of Linz,
    subset of java, VM, written in java very
    interesting alternative, no(?) book, but there is
    20page specification of language syntax and VM.
Write a Comment
User Comments (0)
About PowerShow.com