| summaryrefslogtreecommitdiff |
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-08-03 15:28:17 +0200 |
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-08-03 15:28:17 +0200 |
| commit | 90bb7e959496c3a12bebe055f6344b9f06f22809 (patch) | |
| tree | 6635decc697d91c8cba6da9db8959b706ad9842f /sol_pretty_printer/src/QuickParser.java | |
| parent | c5a23ef9d6ab1e89b85016831fc8b2431f68f87f (diff) | |
Improving clarity through better Makefiles.
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"); - } -} |


