@param args @throws Exception
(String[] args)
| 8 | * @throws Exception |
| 9 | */ |
| 10 | public static void main(String[] args) throws Exception |
| 11 | { |
| 12 | if (args.length < 1) |
| 13 | { |
| 14 | usage(); |
| 15 | return; |
| 16 | } |
| 17 | |
| 18 | String file = args[0]; |
| 19 | // String file="parser_ultimate_test.c"; |
| 20 | // String file="test\\parse_test\\0_example_test.c"; |
| 21 | if (!file.endsWith(".c")) |
| 22 | { |
| 23 | System.out.println("Incorrect input file:" + file); |
| 24 | return; |
| 25 | } |
| 26 | |
| 27 | MiniCCompiler cc = new MiniCCompiler(); |
| 28 | System.out.println("Start to compile ..."); |
| 29 | cc.run(file); |
| 30 | System.out.println("Compiling completed!"); |
| 31 | } |
| 32 | |
| 33 | public static void usage() |
| 34 | { |