package parser;

import java.io.BufferedReader;
import java.io.FileReader;
import java.util.Collection;

/**
 * @author Alexis Giraudet
 */
public class Parser {
    public static boolean parseLine(String fileName, Collection<String> c) {
        try {
            BufferedReader bufferedReader = new BufferedReader(new FileReader(fileName));
            String line;
            while ((line = bufferedReader.readLine()) != null) {
                c.add(line);
            }
        } catch (Exception e) {
            return false;
        }
        return true;
    }
}

@@ -60,32 +60,92 @@
 .io.FileReader;%0A
+import java.io.IOException;%0Aimport java.io.StreamTokenizer;%0A
 import java.util
@@ -237,15 +237,12 @@
 tic 
-boolean
+void
  par
@@ -247,16 +247,17 @@
 arseLine
+s
 (String 
@@ -292,28 +292,29 @@
  c) 
-%7B%0A        try %7B%0A    
+throws IOException %7B%0A
     
@@ -403,20 +403,16 @@
         
- 
-   
 String l
@@ -416,20 +416,16 @@
 g line;%0A
-    
         
@@ -489,20 +489,16 @@
         
-    
 c.add(li
@@ -506,24 +506,26 @@
 e);%0A        
+%7D%0A
     %7D%0A      
@@ -526,21 +526,92 @@
     
+%0A
     
-%7D catch (
+public static void parseTokens(String fileName, Collection%3CString%3E c) throws IO
 Exce
@@ -619,11 +619,8 @@
 tion
- e)
  %7B%0A 
@@ -630,56 +630,315 @@
     
-    return false;%0A        %7D%0A        return true;
+StreamTokenizer streamTokenizer = new StreamTokenizer(new BufferedReader(new FileReader(fileName)));%0A        while(streamTokenizer.nextToken() != StreamTokenizer.TT_EOF) %7B%0A            if(streamTokenizer.ttype == StreamTokenizer.TT_WORD) %7B%0A                c.add(streamTokenizer.sval);%0A            %7D%0A        %7D
 %0A   

add parseTokens function