summaryrefslogtreecommitdiff
path: root/condense/Utilities.java
diff options
context:
space:
mode:
authorbd-912 <bdunahu@colostate.edu>2024-05-06 00:59:26 -0600
committerbd-912 <bdunahu@colostate.edu>2024-05-06 00:59:26 -0600
commit8e33e2828ffc62238afc32bb2593b8619f586077 (patch)
tree60158e69db97739d5e7512210f53c9d2f99fc62d /condense/Utilities.java
parent925372248bfb45e0027cf71d8d40c26e48261ee5 (diff)
Partial implementation for starter Condense
Diffstat (limited to 'condense/Utilities.java')
-rw-r--r--condense/Utilities.java40
1 files changed, 0 insertions, 40 deletions
diff --git a/condense/Utilities.java b/condense/Utilities.java
deleted file mode 100644
index 9c052fc..0000000
--- a/condense/Utilities.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package condense;
-
-import java.util.*;
-
-public class Utilities {
-
-
- public static int computeStackFrameSize(String declare) {
- MinimalLogger.info(String.format("Computing frame stack size for %s...",
- declare));
- declare = extractNumeric(declare);
- // assume that the LAST three digits are
- // in, out, local
- String[] sizes = declare.split(SPACE)[:-3];
- int ret = this.stackFrameFormula(Integer.parseInt(sizes[1]),
- Integer.parseInt(sizes[2]));
- MinimalLogger.info(String.format("Stack size is (%s + %s + 2) * 4 = %d",
- sizes[1],
- sizes[2],
- ret));
- return ret;
- }
-
- private static int stackFrameFormula(int out, int local) {
- return (out + local + 2) * 4;
- }
-
- private static int extractNumeric(String str) {
- str = str.replaceAll("[^\\d] & quot;, "
- ");
- str = str.trim();
- str = str.replaceAll(" + ", "
- ");
- if (str.equals(" "))
- return "
- -1 & quot;
- ;
- return str;
- }
-}