Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.

Contents

Everything here is taken from the slides for the "Compiler Construction" course, i.e. it is directly from Prof. Ronald C. Moore.

Or at least, after all this time, I really don't remember having stolen this code from somewhere else, but if you find an older copy that looks similar, please let me know, so I can give credit where credit is due -- or disavow knowledge of that source (as the case may be).

There are (or will be some day) subdirectories here:

  1. interpreter
    This code take mathematical expressions and evaluates them, i.e. it outputs numbers.

  2. interpreter++
    This code does exactly what interpreter does (except for make test, which does more). The major difference is more extensive use of C++ features, including the new (C++17) std::variant<> template. Testing is also more extensive. This is meant mostly as a preparation for larger projects where software engineering aspects becomes more important whereas the version in interpreter (see above) is meant to get down to recursive descent parsing as quickly as possible.

  3. halfBakedCompiler
    This code takes mathematical expressions and convets them into an AST (Abstract Syntax Tree), then dumps that tree to output (i.e. displays the tree as text). It does nothing really useful, in other words.

  4. LLVMcompiler
    This is vaporware -- in other words, it does not exist yet, and may never do so. But I hope someday to create a version that builds the AST, then converts it to LLVM IR, and then evaluates the IR (using LLVM's JIT capabilities). Perhaps it could some day even create an executable binary? That would be "nice to have", as people say...

Ronald Moore
https://fbi.h-da.de/personen/ronald-moore/
ronald.moore@h-da.de

30 April 2020