Beispiel #1
0
 /**
  * automatically generate non-existing help html files for existing commands in the CommandLoader
  *
  * @param cl the CommandLoader where you look for the existing commands
  */
 public void createHelpText(CommandLoader cl) {
   File dir = new File((getClass().getResource("..").getPath()));
   dir = new File(dir, language);
   if (!dir.exists() && !dir.mkdirs()) {
     System.out.println("Failed to create " + dir.getAbsolutePath());
     return;
   }
   for (String mnemo : cl.getMnemoList()) {
     if (!exists(mnemo)) {
       File file = new File(dir, mnemo + ".htm");
       try {
         file.createNewFile();
         BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream(file));
         PrintStream ps = new PrintStream(os);
         ps.println("<html>\n<head>\n<title>" + mnemo + "\n</title>\n</head>\n<body>");
         ps.println("Command: " + mnemo.toUpperCase() + "<br>");
         ps.println("arguments: <br>");
         ps.println("effects: <br>");
         ps.println("flags to be set: <br>");
         ps.println("approx. clockcycles: <br>");
         ps.println("misc: <br>");
         ps.println("</body>\n</html>");
         ps.flush();
         ps.close();
       } catch (IOException e) {
         System.out.println("failed to create " + file.getAbsolutePath());
       }
     }
   }
 }
Beispiel #2
0
 /** Print an error mesage; like something is broken */
 protected void error(String s) {
   err.println(s);
 }
Beispiel #3
0
 /** Print an output message; like verbose output and the like */
 protected void output(String s) {
   out.println(s);
 }