Skip to content

yoonjaecho/MiniC_Compiler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MiniC to UCode Compiler

About project

This is a MiniC compiler project using JAVA Antlr which generates UCode of IR.

Contents

Simple pointer function

void swap(int *a, int *b) {
    int temp;
    temp = *a;
    *a = *b;
    *b = temp;
}

void main() {
    int a = 5;
    int b = 10;
    swap(&a, &b);
    write(a);
    write(b);
}

Compile error detection

  • Use of undeclared identifier
  • Non-void function should return a value
  • Void function should not return a value
  • Initializing 'int' with an expression of incompatible type 'void'

Make control flow graph

Optimize unreachable code elimination(with Mark & Sweep Algorithm)

Author

Minho Kim, Yoonjae Cho

Releases

No releases published

Packages

No packages published

Languages

  • Java 97.0%
  • ANTLR 2.2%
  • C 0.8%