diff options
author | bd-912 <bdunahu@colostate.edu> | 2024-05-06 01:09:18 -0600 |
---|---|---|
committer | bd-912 <bdunahu@colostate.edu> | 2024-05-06 01:09:18 -0600 |
commit | 21f8331c41f268de77b4cc87f9e118effc6017cb (patch) | |
tree | 23f98b007138574e6a178cd5557153ee813eb752 /V2VM.java | |
parent | 8e33e2828ffc62238afc32bb2593b8619f586077 (diff) |
Condense epilogue, VCall, MemWrite
Diffstat (limited to 'V2VM.java')
-rw-r--r-- | V2VM.java | 21 |
1 files changed, 1 insertions, 20 deletions
@@ -8,12 +8,6 @@ import cs132.vapor.ast.VDataSegment; import cs132.vapor.ast.VFunction; import cs132.vapor.ast.VInstr; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.PrintStream; import java.util.Arrays; import cfg.*; @@ -31,7 +25,7 @@ public class V2VM { InputStream is2 = new ByteArrayInputStream(bytes); InputStream systemInCopy = createCopyOfSystemIn(); - ArrayList<String> strProg = inputStreamToArrayList(is1); + ArrayList<String> strProg = SplitProgramInputStream.split(is1); VaporProgram prog = parseVapor(is2, System.out); @@ -90,19 +84,6 @@ public class V2VM { return program; } - public static ArrayList<String> inputStreamToArrayList(InputStream inputStream) { - ArrayList<String> lines = new ArrayList<>(); - try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) { - String line; - while ((line = reader.readLine()) != null) { - lines.add(line); - } - } catch (IOException e) { - e.printStackTrace(); - } - return lines; - } - public static byte[] readAllBytes(InputStream inputStream) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); int nRead; |