-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMain.java
More file actions
31 lines (25 loc) · 948 Bytes
/
Main.java
File metadata and controls
31 lines (25 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
ByteArrayOutputStream outstream=new ByteArrayOutputStream();
while (true){
int temp=System.in.read();
if (temp==-1) break;
outstream.write(temp);
}
PrintStream old=System.out;
System.setOut(new PrintStream(outstream));
System.setIn(new ByteArrayInputStream(outstream.toByteArray().clone()));
outstream.reset();
new minijava.minijava2piglet.Main().main(args);
System.setIn(new ByteArrayInputStream(outstream.toByteArray().clone()));
outstream.reset();
new piglet.piglet2spiglet.Main().main(args);
System.setIn(new ByteArrayInputStream(outstream.toByteArray().clone()));
outstream.reset();
new spiglet.spiglet2kanga.Main().main(args);
System.setIn(new ByteArrayInputStream(outstream.toByteArray().clone()));
System.setOut(old);
new kanga.kanga2mips.Main().main(args);
}
}