summaryrefslogtreecommitdiff
path: root/src/codegen/Label.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen/Label.java')
-rw-r--r--src/codegen/Label.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/codegen/Label.java b/src/codegen/Label.java
index 52977c7..f0a4c6e 100644
--- a/src/codegen/Label.java
+++ b/src/codegen/Label.java
@@ -4,6 +4,7 @@ public class Label {
private static String funDef = "";
private static int labelCounter = 0;
+ private static int globalVarNum = 0;
private static int functionLabelCounter = 0;
public static void addFunDef(String s) {
@@ -14,6 +15,14 @@ public class Label {
return funDef;
}
+ public static void addGlobalVar() {
+ globalVarNum++;
+ }
+
+ public static int getGlobalVarNum() {
+ return globalVarNum;
+ }
+
/**
* Create a new basic label. Use this method to define labels for if, while and
* for statemests.