Skip to content

beta1360/MiniC-Compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MiniC-Compiler

MiniC Compiler use flex & bison/yacc and C.

The component of Compiler

  1. Ucode interpreter
  2. Lexical Analyzer
  3. Parser
  4. Intermediate Language Generator

Dependency

  • flex
  • bison/yacc

Developing Environment

  • OS : Ubuntu 16.04 LTS
  • Language : C & C++
  • Compiler : gcc & g++

How to use

0. Installation

$ git clone https://github.com/KeonHeeLee/MiniC-Compiler
$ cd MiniC-Compiler
$ sudo chmod +0777 setup.sh
$ ./setup.sh

1. Generate Intermediate Language

$ ./minic <Mini-C file(.mc)>

2. Compile '.uco'(ICG) file

$ ./ucodei <ICG file(.uco)>

Demo Snapshots

  1. Palindrome (pal.mc)

  1. Bubble Sort (bubble.mc)

  1. Factorial (factorial.mc)

  1. Select number (select.mc)

  1. Selection Sort (selection_sort.mc)