Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/codemyst/microj
Compiler for a Java-like language. Made for the Compiler Construction course, at the Faculty of Sciences, Novi Sad.
https://github.com/codemyst/microj
compiler microjava
Last synced: 4 days ago
JSON representation
Compiler for a Java-like language. Made for the Compiler Construction course, at the Faculty of Sciences, Novi Sad.
- Host: GitHub
- URL: https://github.com/codemyst/microj
- Owner: CodeMyst
- License: mit
- Created: 2022-11-09T19:23:38.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-06T09:10:18.000Z (almost 2 years ago)
- Last Synced: 2023-03-02T08:22:32.738Z (almost 2 years ago)
- Topics: compiler, microjava
- Language: Java
- Homepage:
- Size: 159 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# microj ![build badge](https://github.com/CodeMyst/microj/actions/workflows/gradle.yml/badge.svg)
Compiler for a Java-like language. Made for the Compiler Construction course, at the Faculty of Sciences, Novi Sad.
Example of micro java:
```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);
}
}
}
```