This is a MiniC compiler project using JAVA Antlr which generates UCode of IR.
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);
}
- 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'