Skip to content

Commit 75ca6fb

Browse files
first commit
1 parent ecfd840 commit 75ca6fb

13 files changed

+3579
-0
lines changed

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,10 @@
2121

2222
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
2323
hs_err_pid*
24+
25+
.idea/*
26+
*.iml
27+
*.json
28+
SootOutput/*
29+
resources/out/*
30+
out/*

compile.py

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import os
2+
import subprocess
3+
4+
def execute_cmd(cmd):
5+
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
6+
try:
7+
outs, errs = proc.communicate()
8+
return (outs, errs)
9+
except subprocess.TimeoutExpired:
10+
proc.kill()
11+
outs, errs = proc.communicate()
12+
return (outs, errs)
13+
14+
cmd = 'javac ./resources/src/{} -d ./resources/out'
15+
16+
lst = os.listdir('./resources/src')
17+
for el in lst:
18+
if el.endswith('.java'):
19+
print('Compiling {}...'.format(el), end='')
20+
(outs, errs) = execute_cmd(cmd.format(el))
21+
if errs:
22+
print('ERROR.')
23+
print(errs)
24+
else:
25+
print('Done.')
26+

resources/src/Test1.java

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Test1 {
2+
public static void main(String[] args) {
3+
int[] a = new int[5];
4+
int i = 0;
5+
while(i < 5) {
6+
a[i] = i;
7+
i++;
8+
}
9+
}
10+
}

0 commit comments

Comments
 (0)