Mendenbarr

Translater

Sep 24th, 2015
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.00 KB | None | 0 0
  1.  
  2.     public static void main(String[] args) throws IOException {
  3.        
  4.         // Opens a file of the users choice, the code to be
  5.         // translated, and stores it in the bufferedReader "code"
  6.         BufferedReader code = sim.openFileReaderUsingChooser();
  7.        
  8.         // Finds the file ReplacerList.txt that should be stored
  9.         // in this package and stores it in a bufferedReader "replacerdict"
  10.         // This is the full set of words and phrases, and their conversions
  11.         BufferedReader replacerDict = null;
  12.         try {
  13.             replacerDict = new BufferedReader(new FileReader("/Users/Jake/Documents/workspace/CodeTranslator/src/ReplacerList.txt"));
  14.         } catch (IOException e) {
  15.             System.out.print("File is missing. Make sure you have a ReplacerList.txt");
  16.         }
  17.         if (replacerDict != null) dict = readReplacerFile(replacerDict);
  18.         else System.out.print("\nCould not run replacerDict with a null reader.");
  19.        
  20.         // printReplacerDict();
  21.        
  22.         code.mark(100000);
  23.         translateCode(code, false);
  24.         code.reset();
  25.         translateCode(code, true);
  26.        
  27.        
  28.     }
Advertisement
Add Comment
Please, Sign In to add comment