Giter Site home page Giter Site logo

microj's Introduction

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);
		}
	}
}

microj's People

Contributors

codemyst avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

microj's Issues

Files must end with new line

If files don't end with a new line, the last read token isn't EOF. There needs to be a better way to catch EOF.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.