| summaryrefslogtreecommitdiff | 
diff options
Diffstat (limited to 'sol_pretty_printer/src/QuickParser.java')
| -rw-r--r-- | sol_pretty_printer/src/QuickParser.java | 58 | 
1 files changed, 0 insertions, 58 deletions
diff --git a/sol_pretty_printer/src/QuickParser.java b/sol_pretty_printer/src/QuickParser.java deleted file mode 100644 index 19d29e7..0000000 --- a/sol_pretty_printer/src/QuickParser.java +++ /dev/null @@ -1,58 +0,0 @@ -/* FIXME: Finer imports */ -import java.io.*; -import java.util.regex.*; -import java.util.*; - -public class QuickParser -{ -   private static final Pattern instr_pattern; -   private final BufferedReader buffered_reader; - -   static -   { -      instr_pattern = Pattern.compile("\\((?<list>[^)]+)\\)"); -   } -   public QuickParser (final String filename) -   throws FileNotFoundException -   { -      buffered_reader = new BufferedReader(new FileReader(filename)); -   } - -   public void finalize () -   throws IOException -   { -      buffered_reader.close(); -   } - -   public String[] parse_line () -   throws IOException -   { -      final List<String> result; -      final Matcher matcher; -      String line; - -      do -      { -         line = buffered_reader.readLine(); - -         if (line == null) -         { -            return new String[0]; -         } - -         line = line.replaceAll("\\s+"," "); -      } -      while (line.length() < 3 || line.startsWith(";")); - -      matcher = instr_pattern.matcher(line); - -      if (!matcher.find()) -      { -         System.err.println("[E] Invalid instruction \"" + line + "\""); - -         return null; -      } - -      return matcher.group(1).split(" |\t"); -   } -}  | 


