Skip to content

Compiler for a Java-like language. Made for the Compiler Construction course, at the Faculty of Sciences, Novi Sad.

License

Notifications You must be signed in to change notification settings

CodeMyst/microj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

d1c5a19 · Feb 6, 2023

History

25 Commits
Nov 9, 2022
Jan 12, 2023
Nov 9, 2022
Feb 6, 2023
Nov 23, 2022
Nov 9, 2022
Nov 9, 2022
Nov 10, 2022
Nov 9, 2022
Nov 9, 2022
Nov 9, 2022

Repository files navigation

microj build badge

Compiler for a Java-like language. Made for the Compiler Construction course, at the Faculty of Sciences, Novi Sad.

Example of micro java:

program P
	final int size = 10;
	class Table {
		int[] pos;
		int[] neg;
	}
	Table val;
{
	void main()
		int x, i;
	{ //---------- Initialize val
		val = new Table;
		val.pos = new int[size]; val.neg = new int[size];
		i = 0;
		while (i < size) {
			val.pos[i] = 0; val.neg[i] = 0;
			i++;
		}
	//---------- Read values
		read(x);
		while (x != 0) {
			if (0 <= x && x < size) {
				val.pos[x]++;
			} else if (-size < x && x < 0) {
				val.neg[-x]++;
			}
			read(x);
		}
	}
}

About

Compiler for a Java-like language. Made for the Compiler Construction course, at the Faculty of Sciences, Novi Sad.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages