项目作者: jul3x

项目描述 :
Simple compiler from Instant language to JVM bytecode and LLVM bitcode.
高级语言: C++
项目地址: git://github.com/jul3x/InstantCompiler.git
创建时间: 2019-10-28T15:54:12Z
项目社区:https://github.com/jul3x/InstantCompiler

开源协议:GNU General Public License v3.0

下载


InstantCompiler

Simple compiler of Instant language to JVM bytecode and LLVM bitcode.
First task of Compilers Construction course at MIMUW.

Language

Instant is a simple language based on non-negative integers, arithmetical operations and variables.
Non-context grammar of this language is described in src/Instant.cf file (BNF format).

Used tools

  • BNFC 2.8 for compiler front-end generating.

Dependencies

Dependencies of parser and lexer:

  • bison
  • flex

C++:

  • gcc 5.2
  • make

Compilation

Type make in main directory of repository to create two executables - insc_jvm and insc_llvm.

Usage

  • ./insc_jvm foo/bar/in.ins # to compile in.ins file in foo/bar directory

generates files in.j and in.java in foo/bar directory.

  • ./insc_llvm foo/bar/in.ins # to compile in.ins file in foo/bar directory

generates files in.ll and in.bc in foo/bar directory.

Repository structure

  • InstantCompiler
    • src - contains source code of project
    • lib - contains jasmin.jar - tool for translation to JVM bytecode and runtime.bc - file with definitions of helper functions for LLVM bitcode execution
    • tests - contains .ins and .output files with desired output of Instant input