@@ -37,6 +37,7 @@ public class Main {
37
37
private final static String DEFAULT_MIN_TYPE_EXPR = "3" ;
38
38
private final static String DEFAULT_MIN_TYPE_COND = "1" ;
39
39
private final static String DEFAULT_MIN_TYPE_PARAMS = "0" ;
40
+ private final static String DEFAULT_TRANSFORM_ALL = "False" ;
40
41
private final static CType DEFAULT_TYPE = CType .INT ;
41
42
42
43
public static void main (String [] args ) throws IOException {
@@ -56,6 +57,7 @@ public static void main(String[] args) throws IOException {
56
57
int minTypeExpr = Integer .parseInt (DEFAULT_MIN_TYPE_EXPR );
57
58
int minTypeCond = Integer .parseInt (DEFAULT_MIN_TYPE_COND );
58
59
int minTypeParams = Integer .parseInt (DEFAULT_MIN_TYPE_PARAMS );
60
+ boolean transformAll = Boolean .parseBoolean (DEFAULT_TRANSFORM_ALL );
59
61
CType type = DEFAULT_TYPE ;
60
62
try {
61
63
FileReader reader = new FileReader (configFile );
@@ -73,7 +75,7 @@ public static void main(String[] args) throws IOException {
73
75
minTypeExpr = Integer .parseInt (props .getProperty ("minTypeExpr" , DEFAULT_MIN_TYPE_EXPR ));
74
76
minTypeCond = Integer .parseInt (props .getProperty ("minTypeCond" , DEFAULT_MIN_TYPE_COND ));
75
77
minTypeParams = Integer .parseInt (props .getProperty ("minTypeParams" , DEFAULT_MIN_TYPE_PARAMS ));
76
-
78
+ transformAll = Boolean . parseBoolean ( props . getProperty ( "transformAll" , DEFAULT_TRANSFORM_ALL ));
77
79
} catch (IOException exp ) {
78
80
System .out .println ("Invalid configuration file." );
79
81
System .exit (1 );
@@ -111,14 +113,18 @@ public static void main(String[] args) throws IOException {
111
113
ArrayList <File > unsuccessfulCompiles = new ArrayList <File >();
112
114
Iterator <File > file_itr = FileUtils .iterateFiles (destDir , new String [] { "java" }, true );
113
115
114
- file_itr .forEachRemaining (file -> {
115
- boolean success = compile (file );
116
- if (!success ) {
117
- unsuccessfulCompiles .add (file );
118
- } else {
119
- successfulCompiles .add (file );
120
- }
121
- });
116
+ if (transformAll ) {
117
+ file_itr .forEachRemaining (file -> unsuccessfulCompiles .add (file ));
118
+ } else {
119
+ file_itr .forEachRemaining (file -> {
120
+ boolean success = compile (file );
121
+ if (!success ) {
122
+ unsuccessfulCompiles .add (file );
123
+ } else {
124
+ successfulCompiles .add (file );
125
+ }
126
+ });
127
+ }
122
128
123
129
System .out .println (unsuccessfulCompiles + " ------- " + successfulCompiles );
124
130
0 commit comments