public static void main(String[] args) {
        if (args.length != 1) {
			try {
				BufferedReader message = new BufferedReader(new FileReader(new File("bin/help/compiler.txt")));
				String line;
				while ((line=message.readLine()) != null) {
					System.out.println(line);
				}
				System.out.println("");
			} catch (FileNotFoundException e) {
			} catch (IOException e) {
			}

            System.out.println("Usage: java JackCompiler <Jack-dir or Jack-file-name>");
            System.exit(-1);
        }

        JackCompiler jackCompiler = new JackCompiler();
        File file = new File(args[0]);
        if (!file.exists()) {
            System.err.println("Could not find file or directory: " + args[0]);
            System.exit(-1);
        }

		boolean success;
        if (file.isDirectory())
            success = jackCompiler.compileDirectory(args[0]);
        else
            success = jackCompiler.compileFile(file);

		success &= jackCompiler.verify();
		
		System.exit(success? 0 : 1);
    }