MCPcopy Create free account
hub / github.com/Whiley/WhileyCompiler / main

Method main

src/main/java/wyc/Check.java:151–180  ·  view source on GitHub ↗
(String[] _args)

Source from the content-addressed store, hash-verified

149 };
150 //
151 public static void main(String[] _args) throws IOException {
152 List<String> args = new ArrayList<>(Arrays.asList(_args));
153 Map<String, Object> options = OptArg.parseOptions(args, OPTIONS);
154 // Extract config options
155 boolean verbose = options.containsKey("verbose");
156 File wyildir = (File) options.get("wyildir");
157 ArrayList<File> whileypath = (ArrayList<File>) options.get("whileypath");
158 int minInt = (Integer) options.get("min");
159 int maxInt = (Integer) options.get("max");
160 int maxArrayLength = (Integer) options.get("length");
161 int maxTypeDepth = (Integer) options.get("depth");
162 int maxAliasWidth = (Integer) options.get("width");
163 int rotation = (Integer) options.get("rotation");
164 long timeout = (Long) options.get("timeout");
165 String[] ignores = (String[]) options.get("ignores");
166 // Construct Main object
167 Check main = new Check().setVerbose(verbose).setWyilDir(wyildir).setWhileyPath(whileypath)
168 .addConfig(c -> c.setIntegerRange(minInt, maxInt)).addConfig(c -> c.setAliasingWidth(maxAliasWidth))
169 .addConfig(c -> c.setArrayLength(maxArrayLength)).addConfig(c -> c.setTypeDepth(maxTypeDepth))
170 .addConfig(c -> c.setLambdaWidth(rotation)).addConfig(c -> c.setTimeout(timeout))
171 .addConfig(c -> c.setIgnores(ignores));
172 //
173 for(String arg : args) {
174 main.addSource(Trie.fromString(arg));
175 }
176 // Compile Whiley source file(s).
177 boolean result = main.run();
178 // Produce exit code
179 System.exit(result ? 0 : 1);
180 }
181}

Callers

nothing calls this directly

Calls 15

parseOptionsMethod · 0.95
addSourceMethod · 0.95
fromStringMethod · 0.95
runMethod · 0.95
addConfigMethod · 0.80
setIntegerRangeMethod · 0.80
setAliasingWidthMethod · 0.80
setArrayLengthMethod · 0.80
setTypeDepthMethod · 0.80
setLambdaWidthMethod · 0.80
setIgnoresMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected